diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-06-19 20:02:04 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-06-19 20:02:04 +0800 |
commit | c11a9ba63858d3b0c08f687e7893a7759c9d0797 (patch) | |
tree | 39fbf903b967b64c9bc5a71e43bb02aa948c578e /mbbsd/cache.c | |
parent | a7de3a6c4a7022f031087a585e037bdbd39591d8 (diff) | |
download | pttbbs-c11a9ba63858d3b0c08f687e7893a7759c9d0797.tar pttbbs-c11a9ba63858d3b0c08f687e7893a7759c9d0797.tar.gz pttbbs-c11a9ba63858d3b0c08f687e7893a7759c9d0797.tar.bz2 pttbbs-c11a9ba63858d3b0c08f687e7893a7759c9d0797.tar.lz pttbbs-c11a9ba63858d3b0c08f687e7893a7759c9d0797.tar.xz pttbbs-c11a9ba63858d3b0c08f687e7893a7759c9d0797.tar.zst pttbbs-c11a9ba63858d3b0c08f687e7893a7759c9d0797.zip |
Remove unused code
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4381 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cache.c')
-rw-r--r-- | mbbsd/cache.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 7102894b..882204ad 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -90,50 +90,6 @@ attach_SHM(void) SHM->Ftouchtime = 1; } -/* ----------------------------------------------------- */ -/* semaphore : for critical section */ -/* ----------------------------------------------------- */ -#define SEM_FLG 0600 /* semaphore mode */ - -#ifndef __FreeBSD__ -/* according to X/OPEN, we have to define it ourselves */ -union semun { - int val; /* value for SETVAL */ - struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ - unsigned short int *array; /* array for GETALL, SETALL */ - struct seminfo *__buf; /* buffer for IPC_INFO */ -}; -#endif - -void -sem_init(int semkey, int *semid) -{ - union semun s; - - s.val = 1; - *semid = semget(semkey, 1, 0); - if (*semid == -1) { - *semid = semget(semkey, 1, IPC_CREAT | SEM_FLG); - if (*semid == -1) - attach_err(semkey, "semget"); - semctl(*semid, 0, SETVAL, s); - } -} - -void -sem_lock(int op, int semid) -{ - struct sembuf sops; - - sops.sem_num = 0; - sops.sem_flg = SEM_UNDO; - sops.sem_op = op; - if (semop(semid, &sops, 1)) { - perror("semop"); - exit(1); - } -} - /* * section - user cache(including uhash) */ |