Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
3 | #include |
||
4 | #include |
||
5 | #include |
||
6 | #include |
||
7 | #include |
||
8 | |||
9 | static char * __cur_cwd; |
||
10 | |||
11 | extern char* __get_curdir(void); |
||
12 | char * getcwd(char *buf, size_t size) |
||
13 | { |
||
14 | #ifndef min |
||
15 | #define min(a,b) ((a)<(b)?(a):(b)) |
||
16 | #endif |
||
17 | size_t k; |
||
18 | __cur_cwd=__get_curdir(); |
||
19 | k=min(size,strlen(__cur_cwd)); |
||
20 | memcpy(buf,__cur_cwd,k+1); |
||
21 | return buf; |
||
22 | } |
||
23 | |||
24 | void __libc_set_cwd(char * p) |
||
25 | { |
||
26 | __chdir(p); |
||
27 | }(b)?(a):(b)) |