1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

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 commit is contained in:
Jeremy Allison
-
parent 3b25f7368b
commit 148628b616
38 changed files with 98 additions and 64 deletions

View File

@ -101,7 +101,7 @@ void pidfile_create(char *name)
}
memset(buf, 0, sizeof(buf));
slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) getpid());
slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) sys_getpid());
if (write(fd, buf, sizeof(buf)) != sizeof(buf)) {
DEBUG(0,("ERROR: can't write to file %s: %s\n",
pidFile, strerror(errno)));