1 /** @file 2 Implement the invalid functions to return failures. 3 4 Copyright (c) 2011, Intel Corporation 5 All rights reserved. This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 **/ 14 #include <LibConfig.h> 15 #include <sys/EfiCdefs.h> 16 #include <sys/featuretest.h> 17 #include <namespace.h> 18 #include <stdio.h> 19 #include <pwd.h> 20 #include <errno.h> 21 22 struct passwd * getpwuid(uid_t uid)23getpwuid (uid_t uid) 24 { 25 errno = EPERM; 26 return NULL; 27 } 28 29 char * getlogin(void)30getlogin (void) 31 { 32 errno = EPERM; 33 return NULL; 34 } 35 36 struct passwd * getpwnam(const char * name)37getpwnam (const char *name) 38 { 39 errno = EPERM; 40 return NULL; 41 } 42 43 uid_t getuid(void)44getuid (void) 45 { 46 return 0; 47 } 48 49 pid_t getpid(void)50getpid(void) 51 { 52 return 0; 53 } 54 55 pid_t fork(void)56fork (void) 57 { 58 errno = EPERM; 59 return (-1); 60 } 61 62 int chmod(const char * c,mode_t m)63chmod (const char *c, mode_t m) 64 { 65 errno = EPERM; 66 return (-1); 67 } 68 69 pid_t wait(int * stat_loc)70wait(int *stat_loc) { 71 return 0; 72 } 73 74 FILE * popen(const char * cmd,const char * type)75popen (const char *cmd, const char *type) 76 { 77 errno = EPERM; 78 return NULL; 79 } 80 81 int pclose(FILE * stream)82pclose (FILE *stream) 83 { 84 errno = EPERM; 85 return -1; 86 } 87 88 mode_t umask(mode_t cmask)89umask(mode_t cmask) 90 { 91 return (mode_t)0; 92 } 93