1 /* $Cambridge: exim/src/OS/os.h-cygwin,v 1.2 2005/05/24 08:15:01 tom Exp $ */
3 /* Exim: OS-specific C header file for Cygwin */
5 /* This code was supplied by Pierre A. Humblet <Pierre.Humblet@ieee.org> */
7 /* Define the OS_INIT macro that we insert in exim.c:main()
8 to set the root and exim uid depending on the system */
9 /* We use a special routine to initialize */
10 void cygwin_init(int, char **, void *, void *, void *, void *);
12 cygwin_init(argc, (char **) argv, &root_uid, &exim_uid, &exim_gid, &config_uid);
14 /* We need a special mkdir that
15 allows names starting with // */
16 #include <sys/stat.h> /* Do not redefine mkdir in sys/stat.h */
17 int cygwin_mkdir( const char *_path, mode_t __mode );
18 #define mkdir cygwin_mkdir /* redefine mkdir elsewhere */
20 /* Redefine the set*id calls to run when faking root */
21 #include <unistd.h> /* Do not redefine in unitsd.h */
22 int cygwin_setuid(uid_t uid );
23 int cygwin_setgid(gid_t gid );
24 #define setuid cygwin_setuid
25 #define setgid cygwin_setgid
27 extern unsigned int cygwin_WinVersion;
29 #define BASE_62 36 /* Windows aliases lower and upper cases in filenames.
30 Consider reducing MAX_LOCALHOST_NUMBER */
33 #define HAVE_SYS_VFS_H
36 #define F_FREESP O_TRUNC
37 /* Defining LOAD_AVG_NEEDS_ROOT causes an initial
38 call to os_getloadavg. In our case this is beneficial
39 because it initializes the counts */
40 #define LOAD_AVG_NEEDS_ROOT
42 typedef struct flock flock_t;
44 /* Macro to define variable length SID structures */
45 #define SID(n, name, sid...) \
48 BYTE SubAuthorityCount; \
49 SID_IDENTIFIER_AUTHORITY IdentifierAuthority; \
50 DWORD SubAuthority[n]; \
51 } name = { SID_REVISION, n, {SECURITY_NT_AUTHORITY}, {sid}}