aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas/common/sys.h
blob: 960aebb37327c9dc5b510a4a6e78d021d32f01f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * System dependent header files for research
 */

#include <u.h>
#include <libc.h>
#include <regexp.h>
#include <bio.h>
#include "libString.h"   /* jpc String.h -> libString.h */

/*
 *  for the lock routines in libsys.c
 */
typedef struct Mlock	Mlock;
struct Mlock {
	int fd;
	int pid;
	String *name;
};

/*
 *  from config.c
 */
extern char *MAILROOT;	/* root of mail system */
extern char *UPASLOG;	/* log directory */
extern char *UPASLIB;	/* upas library directory */
extern char *UPASBIN;	/* upas binary directory */
extern char *UPASTMP;	/* temporary directory */
extern char *SHELL;	/* path name of shell */
extern char *POST;	/* path name of post server addresses */
extern int MBOXMODE;	/* default mailbox protection mode */

/*
 *  files in libsys.c
 */
extern char	*sysname_read(void);
extern char	*alt_sysname_read(void);
extern char	*domainname_read(void);
extern char	**sysnames_read(void);
extern char	*getlog(void);
extern char	*thedate(void);
extern Biobuf	*sysopen(char*, char*, ulong);
extern int	sysopentty(void);
extern int	sysclose(Biobuf*);
extern int	sysmkdir(char*, ulong);
extern int	syschgrp(char*, char*);
extern Mlock	*syslock(char *);
extern void	sysunlock(Mlock *);
extern void	syslockrefresh(Mlock *);
extern int	e_nonexistent(void);
extern int	e_locked(void);
extern long	sysfilelen(Biobuf*);
extern int	sysremove(char*);
extern int	sysrename(char*, char*);
extern int	sysexist(char*);
extern int	sysisdir(char*);
extern int	syskill(int);
extern int	syskillpg(int);
extern int	syscreate(char*, int, ulong);
extern Mlock	*trylock(char *);
extern void	exit9(int);
extern void	pipesig(int*);
extern void	pipesigoff(void);
extern int	holdon(void);
extern void	holdoff(int);
extern int	syscreatelocked(char*, int, int);
extern int	sysopenlocked(char*, int);
extern int	sysunlockfile(int);
extern int	sysfiles(void);
extern int 	become(char**, char*);
extern int	sysdetach(void);
extern int	sysdirreadall(int, Dir**);
extern String	*username(String*);
extern char*	remoteaddr(int, char*);
extern int	creatembox(char*, char*);

extern String	*readlock(String*);
extern char	*homedir(char*);
extern String	*mboxname(char*, String*);
extern String	*deadletter(String*);

/*
 *  maximum size for a file path
 */
#define MAXPATHLEN 128