CBMC
pwd.c
Go to the documentation of this file.
1 /* FUNCTION: getpwnam */
2 
3 #ifndef _WIN32
4 
5 # ifndef __CPROVER_PWD_H_INCLUDED
6 # include <pwd.h>
7 # define __CPROVER_PWD_H_INCLUDED
8 # endif
9 
11 
12 struct passwd __CPROVER_passwd;
13 
14 struct passwd *getpwnam(const char *name)
15 {
16  // make some fields non-null
17  __CPROVER_passwd.pw_name = (char *)name;
20  return &__CPROVER_passwd;
21 }
22 
23 #endif
24 
25 /* FUNCTION: getpwuid */
26 
27 #ifndef _WIN32
28 
29 # ifndef __CPROVER_PWD_H_INCLUDED
30 # include <pwd.h>
31 # define __CPROVER_PWD_H_INCLUDED
32 # endif
33 
34 unsigned __VERIFIER_nondet_unsigned(void);
35 
36 # ifndef LIBRARY_CHECK
37 struct passwd __CPROVER_passwd;
38 # endif
39 
40 struct passwd *getpwuid(uid_t uid)
41 {
42  // make some fields non-null
43  __CPROVER_passwd.pw_uid = uid;
45  return &__CPROVER_passwd;
46 }
47 
48 #endif
struct passwd * getpwnam(const char *name)
Definition: pwd.c:14
unsigned __VERIFIER_nondet_unsigned(void)
struct passwd __CPROVER_passwd
Definition: pwd.c:12
struct passwd * getpwuid(uid_t uid)
Definition: pwd.c:40