summaryrefslogtreecommitdiff
path: root/source3/include/proto.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-10 14:41:20 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-10 14:41:20 +0000
commit0af00edf672eda7556f12745c80873376b85676f (patch)
tree96bdd16f282ccca726a0c739de2585f705032e4f /source3/include/proto.h
parent735ee07018f4514771d26e01b41b0f02295b8b48 (diff)
downloadsamba-0af00edf672eda7556f12745c80873376b85676f.tar.gz
samba-0af00edf672eda7556f12745c80873376b85676f.tar.bz2
samba-0af00edf672eda7556f12745c80873376b85676f.zip
I'm currently designing a new locking system (using a tdb database!)
that will make us match NT semantics exactly and do away with the horrible fd multiplexing in smbd. this is some diag stuff to get me started. - added the ability to do read or write locks in clientgen.c - added a LOCK4 test to smbtorture. This produces a report on the server and its locking capabilities. For example, NT4 gives this: the same process cannot set overlapping write locks the same process can set overlapping read locks a different connection cannot set overlapping write locks a different connection can set overlapping read locks a different pid cannot set overlapping write locks a different pid can set overlapping read locks the same process can set the same read lock twice the same process cannot set the same write lock twice the same process cannot override a read lock with a write lock the same process can override a write lock with a read lock a different pid cannot override a write lock with a read lock the same process cannot coalesce read locks this server does strict write locking this server does strict read locking whereas Samba currently gives this: the same process can set overlapping write locks the same process can set overlapping read locks a different connection cannot set overlapping write locks a different connection can set overlapping read locks a different pid can set overlapping write locks a different pid can set overlapping read locks the same process can set the same read lock twice the same process can set the same write lock twice the same process can override a read lock with a write lock the same process can override a write lock with a read lock a different pid can override a write lock with a read lock the same process can coalesce read locks this server does strict write locking this server does strict read locking win95 gives this - I don't understand why! the same process cannot set overlapping write locks the same process cannot set overlapping read locks a different connection cannot set overlapping write locks a different connection cannot set overlapping read locks a different pid cannot set overlapping write locks a different pid cannot set overlapping read locks the same process cannot set the same read lock twice the same process cannot set the same write lock twice the same process cannot override a read lock with a write lock the same process cannot override a write lock with a read lock a different pid cannot override a write lock with a read lock the same process cannot coalesce read locks this server does strict write locking this server does strict read locking (This used to be commit 49637936b6e9478df248c4ef73d818870c73b597)
Diffstat (limited to 'source3/include/proto.h')
-rw-r--r--source3/include/proto.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0388ef6911..2db1f3ed02 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -587,8 +587,10 @@ BOOL cli_rmdir(struct cli_state *cli, char *dname);
int cli_nt_create(struct cli_state *cli, char *fname);
int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode);
BOOL cli_close(struct cli_state *cli, int fnum);
-BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
-BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
+BOOL cli_lock(struct cli_state *cli, int fnum,
+ uint32 offset, uint32 len, int timeout, int locktype);
+BOOL cli_unlock(struct cli_state *cli, int fnum,
+ uint32 offset, uint32 len, int timeout, int locktype);
size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
ssize_t cli_write(struct cli_state *cli,
int fnum, uint16 write_mode,
@@ -2972,6 +2974,7 @@ int smbw_stat(const char *fname, struct stat *st);
/*The following definitions come from tdb/tdb.c */
+char *tdb_error(TDB_CONTEXT *tdb);
int tdb_update(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf);
TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);