Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/getcwd.c
Show All 38 Lines | |||||
#include <dirent.h> | #include <dirent.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <ssp/ssp.h> | |||||
#include "un-namespace.h" | #include "un-namespace.h" | ||||
#include "gen-private.h" | #include "gen-private.h" | ||||
#define ISDOT(dp) \ | #define ISDOT(dp) \ | ||||
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ | (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ | ||||
(dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) | (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) | ||||
extern int __getcwd(char *, size_t); | extern int __getcwd(char *, size_t); | ||||
char * | char * | ||||
getcwd(char *pt, size_t size) | __ssp_real(getcwd)(char *pt, size_t size) | ||||
{ | { | ||||
struct dirent *dp; | struct dirent *dp; | ||||
DIR *dir = NULL; | DIR *dir = NULL; | ||||
dev_t dev; | dev_t dev; | ||||
ino_t ino; | ino_t ino; | ||||
int first; | int first; | ||||
char *bpt; | char *bpt; | ||||
struct stat s; | struct stat s; | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |