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/libsmb/clientgen.c | 2 +- source3/libsmb/namequery.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index a3a2483bd5..32564aaf82 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -172,7 +172,7 @@ struct cli_state *cli_initialise(struct cli_state *cli) cli->port = 0; cli->fd = -1; cli->cnum = -1; - cli->pid = (uint16)getpid(); + cli->pid = (uint16)sys_getpid(); cli->mid = 1; cli->vuid = UID_FIELD_INVALID; cli->protocol = PROTOCOL_NT1; diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 500a2ff94f..0db1e367dc 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -35,7 +35,7 @@ static int generate_trn_id(void) static int trn_id; if (trn_id == 0) { - srandom(getpid()); + srandom(sys_getpid()); } trn_id = random(); -- cgit