-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsysdef.h
More file actions
74 lines (57 loc) · 1.64 KB
/
sysdef.h
File metadata and controls
74 lines (57 loc) · 1.64 KB
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
/* $OpenBSD: sysdef.h,v 1.16 2008/09/15 16:11:35 kjell Exp $ */
/* This file is in the public domain. */
/*
* POSIX system header file
*/
#include "config.h"
#include <sys/param.h>
#include <sys/types.h>
/* This is the queue.h from OpenBSD/NetBSD, works fine. The one provided by
others is incompatible. */
#if !defined(__OPENBSD__) && !defined(__NETBSD__)
# include "queue.h"
#else
# include <sys/queue.h>
#endif
/* necesarry to get asprintf & friends with glibc XXX doesn't work for some
* mysterious reason! */
#ifdef __GLIBC__
# define _GNU_SOURCE
# define __USE_GNU
#endif
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#define KBLOCK 8192 /* Kill grow. */
#define GOOD 0 /* Good exit status. */
#define SYMBLINK 1 /* Handle symbolic links. */
typedef int RSIZE; /* Type for file/region sizes */
typedef short KCHAR; /* Type for internal keystrokes */
#define MALLOCROUND(m) (m+=7,m&=~7) /* round up to 8 byte boundary */
struct fileinfo {
uid_t fi_uid;
gid_t fi_gid;
mode_t fi_mode;
struct timespec fi_mtime; /* Last modified time */
};
/* extra headers missing from glibc */
#ifdef HAVE_NOSTRLCPY
extern size_t strlcpy(char *, const char *, size_t);
#endif
#ifdef HAVE_NOSTRLCAT
extern size_t strlcat(char *, const char *, size_t);
#endif
/* not provided by glibc stdio.h */
#ifdef HAVE_NOFGETLN
extern char * fgetln(FILE *, size_t *);
#endif
/* strtonum missing on other BSD's */
#ifdef HAVE_NOSTRTONUM
extern long long strtonum(const char *, long long, long long, const char **);
#endif
#ifndef LOGIN_NAME_MAX
#define LOGIN_NAME_MAX MAXLOGNAME
#endif