summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-05-02 02:23:41 +0000
committerJeremy Allison <jra@samba.org>2000-05-02 02:23:41 +0000
commit693ffb8466ada58ecc59fde754ba79fc6f51528d (patch)
tree639fae54b3d874aae78e5732aef20f52de5b60bf /source3/smbd/oplock.c
parent830a9e571eee5330097376e94af7dc0f2d5f2f02 (diff)
downloadsamba-693ffb8466ada58ecc59fde754ba79fc6f51528d.tar.gz
samba-693ffb8466ada58ecc59fde754ba79fc6f51528d.tar.bz2
samba-693ffb8466ada58ecc59fde754ba79fc6f51528d.zip
Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
Diffstat (limited to 'source3/smbd/oplock.c')
-rw-r--r--source3/smbd/oplock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 28ab29d027..4a363d45e9 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -111,7 +111,7 @@ address %lx. Error was %s\n", (long)htonl(INADDR_LOOPBACK), strerror(errno)));
return False;
DEBUG(3,("open_oplock ipc: pid = %d, global_oplock_port = %u\n",
- (int)getpid(), global_oplock_port));
+ (int)sys_getpid(), global_oplock_port));
return True;
}
@@ -1088,7 +1088,7 @@ BOOL request_oplock_break(share_mode_entry *share_entry,
{
char op_break_msg[OPLOCK_BREAK_MSG_LEN];
struct sockaddr_in addr_out;
- pid_t pid = getpid();
+ pid_t pid = sys_getpid();
time_t start_time;
int time_left;
long usec;
@@ -1342,7 +1342,7 @@ void check_kernel_oplocks(void)
set_process_capability(KERNEL_OPLOCK_CAPABILITY,True);
set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY,True);
- slprintf(tmpname,sizeof(tmpname)-1, "%s/koplock.%d", lp_lockdir(), (int)getpid());
+ slprintf(tmpname,sizeof(tmpname)-1, "%s/koplock.%d", lp_lockdir(), (int)sys_getpid());
if(pipe(pfd) != 0) {
DEBUG(0,("check_kernel_oplocks: Unable to create pipe. Error was %s\n",