summaryrefslogtreecommitdiff
path: root/source3/locking/locking.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/locking/locking.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/locking/locking.c')
-rw-r--r--source3/locking/locking.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 75198d6303..47ae917f9a 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -69,7 +69,7 @@ BOOL is_locked(files_struct *fsp,connection_struct *conn,
return(False);
ret = !brl_locktest(fsp->dev, fsp->inode,
- global_smbpid, getpid(), conn->cnum,
+ global_smbpid, sys_getpid(), conn->cnum,
offset, count, lock_type);
/*
@@ -107,7 +107,7 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn,
if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) {
ok = brl_lock(fsp->dev, fsp->inode, fsp->fnum,
- global_smbpid, getpid(), conn->cnum,
+ global_smbpid, sys_getpid(), conn->cnum,
offset, count,
lock_type);
@@ -127,7 +127,7 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn,
* lock entry.
*/
(void)brl_unlock(fsp->dev, fsp->inode, fsp->fnum,
- global_smbpid, getpid(), conn->cnum,
+ global_smbpid, sys_getpid(), conn->cnum,
offset, count);
}
}
@@ -170,7 +170,7 @@ BOOL do_unlock(files_struct *fsp,connection_struct *conn,
*/
ok = brl_unlock(fsp->dev, fsp->inode, fsp->fnum,
- global_smbpid, getpid(), conn->cnum, offset, count);
+ global_smbpid, sys_getpid(), conn->cnum, offset, count);
if (!ok) {
DEBUG(10,("do_unlock: returning ERRlock.\n" ));
@@ -193,7 +193,7 @@ BOOL do_unlock(files_struct *fsp,connection_struct *conn,
void locking_close_file(files_struct *fsp)
{
- pid_t pid = getpid();
+ pid_t pid = sys_getpid();
if (!lp_locking(SNUM(fsp->conn)))
return;
@@ -337,7 +337,7 @@ void del_share_mode(files_struct *fsp)
struct locking_data *data;
int i, del_count=0;
share_mode_entry *shares;
- pid_t pid = getpid();
+ pid_t pid = sys_getpid();
/* read in the existing share modes */
dbuf = tdb_fetch(tdb, locking_key_fsp(fsp));
@@ -380,7 +380,7 @@ fill a share mode entry
static void fill_share_mode(char *p, files_struct *fsp, uint16 port, uint16 op_type)
{
share_mode_entry *e = (share_mode_entry *)p;
- e->pid = getpid();
+ e->pid = sys_getpid();
e->share_mode = fsp->share_mode;
e->op_port = port;
e->op_type = op_type;
@@ -453,7 +453,7 @@ static BOOL mod_share_mode(files_struct *fsp,
struct locking_data *data;
int i;
share_mode_entry *shares;
- pid_t pid = getpid();
+ pid_t pid = sys_getpid();
int need_store=0;
/* read in the existing share modes */