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: Unix compatibility routines
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
25
* Date: 14 September 1996
26
* Last Edited: 30 August 2006
32
* This file is dedicated to my dog, Unix, also known as Yun-chan and
33
* Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix
34
* passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after
35
* a two-month bout with cirrhosis of the liver.
37
* He was a dear friend, and I miss him terribly.
39
* Lift a leg, Yunie. Luv ya forever!!!!
42
/* For flock() emulation */
50
/* syslog() emulation */
52
#define LOG_MAIL (2<<3) /* mail system */
53
#define LOG_DAEMON (3<<3) /* system daemons */
54
#define LOG_AUTH (4<<3) /* security/authorization messages */
55
#define LOG_EMERG 0 /* system is unusable */
56
#define LOG_ALERT 1 /* action must be taken immediately */
57
#define LOG_CRIT 2 /* critical conditions */
58
#define LOG_ERR 3 /* error conditions */
59
#define LOG_WARNING 4 /* warning conditions */
60
#define LOG_NOTICE 5 /* normal but signification condition */
61
#define LOG_INFO 6 /* informational */
62
#define LOG_DEBUG 7 /* debug-level messages */
63
#define LOG_PID 0x01 /* log the pid with each message */
64
#define LOG_CONS 0x02 /* log on the console if errors in sending */
65
#define LOG_ODELAY 0x04 /* delay open until syslog() is called */
66
#define LOG_NDELAY 0x08 /* don't delay open */
67
#define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */
69
#define tmpfile create_tempfile
70
#define fclose close_file
72
#define ftruncate chsize
73
#define gethostid clock
74
#define sleep(x) Sleep (1000 * x)
77
long alarm (long seconds);
78
int flock (int fd,int op);
79
void openlog (const char *ident,int logopt,int facility);
80
void syslog (int priority,const char *message,...);
81
unsigned long unix_crlfcpy (char **dst,unsigned long *dstl,char *src,
83
unsigned long unix_crlflen (STRING *s);
84
FILE *create_tempfile (void);
85
int close_file (FILE *stream);
86
char *getpass (const char *prompt);