]> git.ipfire.org Git - thirdparty/systemd.git/blob - klibc_fixups.h
6dfd5a5c17e631fbb6e49bddcb9328f00636fbee
[thirdparty/systemd.git] / klibc_fixups.h
1 #ifdef __KLIBC__
2
3 #ifndef KLIBC_FIXUPS_H
4 #define KLIBC_FIXUPS_H
5
6 #include <linux/kernel.h>
7 #include <linux/unistd.h>
8
9 int sysinfo(struct sysinfo *info);
10
11 struct passwd {
12 char *pw_name; /* user name */
13 char *pw_passwd; /* user password */
14 uid_t pw_uid; /* user id */
15 gid_t pw_gid; /* group id */
16 char *pw_gecos; /* real name */
17 char *pw_dir; /* home directory */
18 char *pw_shell; /* shell program */
19 };
20
21 struct group {
22 char *gr_name; /* group name */
23 char *gr_passwd; /* group password */
24 gid_t gr_gid; /* group id */
25 char **gr_mem; /* group members */
26 };
27
28 struct passwd *getpwnam(const char *name);
29 struct group *getgrnam(const char *name);
30
31
32 #define UT_LINESIZE 32
33 #define UT_NAMESIZE 32
34 #define UT_HOSTSIZE 256
35 #define USER_PROCESS 7 /* normal process */
36 #define ut_time ut_tv.tv_sec
37
38
39 extern int ufd;
40
41 struct exit_status {
42 short int e_termination; /* process termination status */
43 short int e_exit; /* process exit status */
44 };
45
46 struct utmp
47 {
48 short int ut_type; /* type of login */
49 pid_t ut_pid; /* pid of login process */
50 char ut_line[UT_LINESIZE]; /* devicename */
51 char ut_id[4]; /* Inittab id */
52 char ut_user[UT_NAMESIZE]; /* username */
53 char ut_host[UT_HOSTSIZE]; /* hostname for remote login */
54 struct exit_status ut_exit; /* exit status of a process marked as DEAD_PROCESS */
55 /* The ut_session and ut_tv fields must be the same size for 32 and 64-bit */
56 #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
57 int32_t ut_session; /* sid used for windowing */
58 struct {
59 int32_t tv_sec; /* seconds */
60 int32_t tv_usec; /* microseconds */
61 } ut_tv;
62 #else
63 long int ut_session;
64 struct timeval ut_tv;
65 #endif
66 int32_t ut_addr_v6[4]; /* internet address of remote host */
67 char __unused[20]; /* reserved for future use */
68 };
69
70 struct utmp *getutent(void);
71 void setutent(void);
72 void endutent(void);
73
74
75 #endif /* KLIBC_FIXUPS_H */
76 #endif /* __KLIBC__ */