get_current_dir_name

    C / LINUX getcwd(2) get_current_dir_name(2)

    함수 기능 현재 작업 디렉토리에 대한 전체 경로 이름을 얻을 수 있는 시스템 호출 get_current_dir_name = getcwd(NULL,0) 함수 원형 #include char *getcwd(char *buf, size_t size); char *get_current_dir_name(); 리턴 값 : 성공 시 현재 작업 디렉토리의 pathname, 에러시 null 리턴 함수 파라메터 BUF 현재작업디렉토리 경로저장할 버퍼 SIZE 버퍼 사이즈 함수 예제 #include #include #include #define PATH_MAX 1024 int main(void){ char *pathname; if(chdir("/home/oslab")