sendmail: Update vendor branch to v8.14.4
[dragonfly.git] / contrib / sendmail-8.14 / include / sm / sem.h
blob3ac0bc61cc3c56d1fa393bc39fde707fd2393f10
1 /*
2 * Copyright (c) 2000-2001, 2005, 2008 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
9 * $Id: sem.h,v 1.10 2008/05/30 16:26:39 ca Exp $
12 #ifndef SM_SEM_H
13 # define SM_SEM_H 1
15 #include <sm/gen.h>
17 /* key for semaphores */
18 # define SM_SEM_KEY (41L)
19 # define SM_SEM_NO_ID (-1)
20 # define SM_NO_SEM(id) ((id) < 0)
22 # if SM_CONF_SEM > 0
23 # include <sys/types.h>
24 # include <sys/ipc.h>
25 # include <sys/sem.h>
27 # if SM_CONF_SEM == 2
28 union semun
30 int val;
31 struct semid_ds *buf;
32 ushort *array;
34 # endif /* SM_CONF_SEM == 2 */
36 # ifndef SEM_A
37 # define SEM_A 0200
38 # endif /* SEM_A */
39 # ifndef SEM_R
40 # define SEM_R 0400
41 # endif /* SEM_R */
43 # define SM_NSEM 1
45 extern int sm_sem_start __P((key_t, int, int, bool));
46 extern int sm_sem_stop __P((int));
47 extern int sm_sem_acq __P((int, int, int));
48 extern int sm_sem_rel __P((int, int, int));
49 extern int sm_sem_get __P((int, int));
50 extern int sm_semsetowner __P((int, uid_t, gid_t, mode_t));
52 # else /* SM_CONF_SEM > 0 */
53 # define sm_sem_start(key, nsem, semflg, owner) 0
54 # define sm_sem_stop(semid) 0
55 # define sm_sem_acq(semid, semnum, timeout) 0
56 # define sm_sem_rel(semid, semnum, timeout) 0
57 # define sm_sem_get(semid, semnum) 0
58 # endif /* SM_CONF_SEM > 0 */
60 #endif /* ! SM_SEM_H */