Displaying 1 result from an estimated 1 matches for "gid_ptr".
Did you mean:
sid_ptr
2003 May 19
0
[PATCH] getpwnam() implementation in tftpd.c
...nt a compiler warning */
+struct passwd *__getpwent(int pwd_fd);
+struct passwd *getpwnam(const char *name);
+
+#define PWD_BUFFER_SIZE 256
+struct passwd *__getpwent(int pwd_fd)
+{
+ static char line_buff[PWD_BUFFER_SIZE];
+ static struct passwd passwd;
+ char *field_begin;
+ char *endptr;
+ char *gid_ptr=NULL;
+ char *uid_ptr=NULL;
+ int line_len;
+ int i;
+
+ /* We use the restart label to handle malformatted lines */
+ restart:
+ /* Read the passwd line into the static buffer using a minimal of
+ syscalls. */
+ if ((line_len = read(pwd_fd, line_buff, PWD_BUFFER_SIZE)) <= 0)
+ return NULL;...