From 693ffb8466ada58ecc59fde754ba79fc6f51528d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 2 May 2000 02:23:41 +0000 Subject: 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) --- source3/rpc_server/srv_lsa_hnd.c | 2 +- source3/rpc_server/srv_pipe_hnd.c | 4 ++-- source3/rpc_server/srv_spoolss_nt.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c index 937da42ec8..58a7dc6913 100644 --- a/source3/rpc_server/srv_lsa_hnd.c +++ b/source3/rpc_server/srv_lsa_hnd.c @@ -76,7 +76,7 @@ static void create_pol_hnd(POLICY_HND *hnd) SIVAL(hnd->data, 4 , pol_hnd_low ); /* second bit is incrementing */ SIVAL(hnd->data, 8 , pol_hnd_high); /* second bit is incrementing */ SIVAL(hnd->data, 12, time(NULL)); /* something random */ - SIVAL(hnd->data, 16, getpid()); /* something more random */ + SIVAL(hnd->data, 16, sys_getpid()); /* something more random */ } /**************************************************************************** diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 2d11c5eda5..7110342383 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -144,7 +144,7 @@ static void attempt_remote_rpc_connect(pipes_struct *p) */ become_root(False); /* to connect to pipe */ - p->m = msrpc_use_add(p->name, getpid(), &usr, False); + p->m = msrpc_use_add(p->name, sys_getpid(), &usr, False); unbecome_root(False); if (p->m == NULL) @@ -170,7 +170,7 @@ pipes_struct *open_rpc_pipe_p(char *pipe_name, log files and prevents client bugs where pipe numbers are reused over connection restarts */ if (next_pipe == 0) - next_pipe = (getpid() ^ time(NULL)) % MAX_OPEN_PIPES; + next_pipe = (sys_getpid() ^ time(NULL)) % MAX_OPEN_PIPES; i = bitmap_find(bmap, next_pipe); diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 1daa7e55da..2680c3a553 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -135,7 +135,7 @@ static void create_printer_hnd(POLICY_HND *hnd) SIVAL(hnd->data, 4 , prt_hnd_low ); /* second bit is incrementing */ SIVAL(hnd->data, 8 , prt_hnd_high); /* second bit is incrementing */ SIVAL(hnd->data, 12, time(NULL)); /* something random */ - SIVAL(hnd->data, 16, getpid()); /* something more random */ + SIVAL(hnd->data, 16, sys_getpid()); /* something more random */ } /**************************************************************************** -- cgit