diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-07-25 08:35:17 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-07-25 12:15:02 +0200 |
commit | b0f1921bd733e9ad4f8fef720fab2fd0ed675f12 (patch) | |
tree | 123d609663f6bf4751f9273f7e24a52d8bbf894d | |
parent | e0bc1650805159645ae2217a81fbf92d656f0e34 (diff) | |
download | samba-b0f1921bd733e9ad4f8fef720fab2fd0ed675f12.tar.gz samba-b0f1921bd733e9ad4f8fef720fab2fd0ed675f12.tar.bz2 samba-b0f1921bd733e9ad4f8fef720fab2fd0ed675f12.zip |
s3:torture: remove unused shm_setup()
metze
-rw-r--r-- | source3/torture/proto.h | 1 | ||||
-rw-r--r-- | source3/torture/torture.c | 55 |
2 files changed, 0 insertions, 56 deletions
diff --git a/source3/torture/proto.h b/source3/torture/proto.h index 4104fbc998..0c6fc70c28 100644 --- a/source3/torture/proto.h +++ b/source3/torture/proto.h @@ -63,7 +63,6 @@ bool torture_nttrans_scan(int dummy); /* The following definitions come from torture/torture.c */ -void *shm_setup(int size); bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx, char **hostname, char **sharename); bool torture_open_connection(struct cli_state **c, int conn_index); diff --git a/source3/torture/torture.c b/source3/torture/torture.c index ca72f5e963..306bca1237 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -72,61 +72,6 @@ bool torture_showall = False; static double create_procs(bool (*fn)(int), bool *result); - -/* return a pointer to a anonymous shared memory segment of size "size" - which will persist across fork() but will disappear when all processes - exit - - The memory is not zeroed - - This function uses system5 shared memory. It takes advantage of a property - that the memory is not destroyed if it is attached when the id is removed - */ -void *shm_setup(int size) -{ - int shmid; - void *ret; - -#ifdef __QNXNTO__ - shmid = shm_open("private", O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); - if (shmid == -1) { - printf("can't get shared memory\n"); - exit(1); - } - shm_unlink("private"); - if (ftruncate(shmid, size) == -1) { - printf("can't set shared memory size\n"); - exit(1); - } - ret = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, shmid, 0); - if (ret == MAP_FAILED) { - printf("can't map shared memory\n"); - exit(1); - } -#else - shmid = shmget(IPC_PRIVATE, size, S_IRUSR | S_IWUSR); - if (shmid == -1) { - printf("can't get shared memory\n"); - exit(1); - } - ret = (void *)shmat(shmid, 0, 0); - if (!ret || ret == (void *)-1) { - printf("can't attach to shared memory\n"); - return NULL; - } - /* the following releases the ipc, but note that this process - and all its children will still have access to the memory, its - just that the shmid is no longer valid for other shm calls. This - means we don't leave behind lots of shm segments after we exit - - See Stevens "advanced programming in unix env" for details - */ - shmctl(shmid, IPC_RMID, 0); -#endif - - return ret; -} - /******************************************************************** Ensure a connection is encrypted. ********************************************************************/ |