1
/* ========================================================================
2
* Copyright 1988-2006 University of Washington
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
11
* ========================================================================
15
* Program: Operating-system dependent routines -- SVR2 version
17
* Author: Mark Crispin
18
* Networks and Distributed Computing
19
* Computing & Communications
20
* University of Washington
21
* Administration Building, AG-44
23
* Internet: MRC@CAC.Washington.EDU
26
* Last Edited: 20 December 2006
34
#include <sys/types.h>
42
/* Many versions of SysV get this wrong */
44
#define setpgrp(a,b) Setpgrp(a,b)
45
int Setpgrp (int pid,int gid);
48
/* Different names between BSD and SVR4 */
50
#define L_SET SEEK_SET
51
#define L_INCR SEEK_CUR
52
#define L_XTND SEEK_END
55
#define random lrand48
57
#define SIGSTOP SIGQUIT
59
#define S_IFLNK 0120000
62
/* syslog() emulation */
64
#define LOG_MAIL (2<<3) /* mail system */
65
#define LOG_DAEMON (3<<3) /* system daemons */
66
#define LOG_AUTH (4<<3) /* security/authorization messages */
67
#define LOG_ALERT 1 /* action must be taken immediately */
68
#define LOG_CONS 0x02 /* log on the console if errors in sending */
69
#define LOG_ODELAY 0x04 /* delay open until syslog() is called */
70
#define LOG_NDELAY 0x08 /* don't delay open */
71
#define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */
74
/* For setitimer() emulation */
79
/* For opendir() emulation */
81
typedef struct _dirdesc {
88
struct passwd *getpwent (void);
89
struct passwd *getpwuid (int uid);
90
struct passwd *getpwnam (char *name);
91
struct group *getgrnam (char *name);
93
char *getenv (char *name);
94
long gethostid (void);
95
void *memmove (void *s,void *ct,size_t n);
96
char *strstr (char *cs,char *ct);
97
char *strerror (int n);
98
unsigned long strtoul (char *s,char **endp,int base);
99
DIR *opendir (char * name);
100
int closedir (DIR *d);
101
struct direct *readdir (DIR *d);
102
typedef int (*select_t) (struct direct *name);
103
typedef int (*compar_t) (void *d1,void *d2);
104
int scandir (char *dirname,struct direct ***namelist,select_t select,
106
int alphasort (void *d1,void *d2);
108
int openlog (ident,logopt,facility);
109
int syslog (priority,message,parameters ...);
110
void *malloc (size_t byteSize);
111
void free (void *ptr);
112
void *realloc (void *oldptr,size_t newsize);
115
#include "env_unix.h"
120
#include "flocksim.h"