xref: /illumos-gate/usr/src/cmd/sendmail/include/sm/shm.h (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2000-2003, 2005 Sendmail, Inc. and its suppliers.
3*7c478bd9Sstevel@tonic-gate  *      All rights reserved.
4*7c478bd9Sstevel@tonic-gate  *
5*7c478bd9Sstevel@tonic-gate  * By using this file, you agree to the terms and conditions set
6*7c478bd9Sstevel@tonic-gate  * forth in the LICENSE file which can be found at the top level of
7*7c478bd9Sstevel@tonic-gate  * the sendmail distribution.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  *	$Id: shm.h,v 1.11 2005/01/13 22:57:04 ca Exp $
10*7c478bd9Sstevel@tonic-gate  */
11*7c478bd9Sstevel@tonic-gate 
12*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
13*7c478bd9Sstevel@tonic-gate 
14*7c478bd9Sstevel@tonic-gate #ifndef SM_SHM_H
15*7c478bd9Sstevel@tonic-gate # define SM_SHM_H
16*7c478bd9Sstevel@tonic-gate 
17*7c478bd9Sstevel@tonic-gate # if SM_CONF_SHM
18*7c478bd9Sstevel@tonic-gate #  include <sys/types.h>
19*7c478bd9Sstevel@tonic-gate #  include <sys/ipc.h>
20*7c478bd9Sstevel@tonic-gate #  include <sys/shm.h>
21*7c478bd9Sstevel@tonic-gate 
22*7c478bd9Sstevel@tonic-gate /* # include "def.h"	*/
23*7c478bd9Sstevel@tonic-gate 
24*7c478bd9Sstevel@tonic-gate /* key for shared memory */
25*7c478bd9Sstevel@tonic-gate #  define SM_SHM_KEY	((key_t) 42)
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /* return value for failed shmget() */
28*7c478bd9Sstevel@tonic-gate #  define SM_SHM_NULL	((void *) -1)
29*7c478bd9Sstevel@tonic-gate #  define SM_SHM_NO_ID	(-2)
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate extern void *sm_shmstart __P((key_t, int , int , int *, bool));
32*7c478bd9Sstevel@tonic-gate extern int sm_shmstop __P((void *, int, bool));
33*7c478bd9Sstevel@tonic-gate extern int sm_shmsetowner __P((int, uid_t, gid_t, mode_t));
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate /* for those braindead systems... (e.g., SunOS 4) */
37*7c478bd9Sstevel@tonic-gate #  ifndef SHM_R
38*7c478bd9Sstevel@tonic-gate #   define SHM_R       0400
39*7c478bd9Sstevel@tonic-gate #  endif /* SHM_R */
40*7c478bd9Sstevel@tonic-gate #  ifndef SHM_W
41*7c478bd9Sstevel@tonic-gate #   define SHM_W       0200
42*7c478bd9Sstevel@tonic-gate #  endif /* SHM_W */
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate # endif /* SM_CONF_SHM */
45*7c478bd9Sstevel@tonic-gate #endif /* ! SM_SHM_H */
46