home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / W2KPRK.iso / apps / posix / source / SH / STD / POSIX / UNISTD.C < prev    next >
C/C++ Source or Header  |  1999-11-17  |  459b  |  42 lines

  1. /* misc. POSIX emulation */
  2.  
  3. /* $Header$ */
  4.  
  5. #include <string.h>
  6. #include <errno.h>
  7. #include <sys/types.h>
  8. #include <unistd.h>
  9.  
  10. #if _V7 || _BSD
  11.  
  12. char *
  13. getcwd(buf, len)
  14.     char *buf;
  15.     size_t len;
  16. {
  17.     char cwd [1024];
  18.     extern char *getwd();
  19.     if (getwd(cwd) == NULL)
  20.         return NULL;
  21.     if (strlen(cwd)+1 >= len) {
  22.         errno = ERANGE;
  23.         return NULL;
  24.     }
  25.     return strcpy(buf, cwd);
  26. }
  27.  
  28. #endif
  29.  
  30. #if _V7
  31.  
  32. long
  33. ulimit(cmd, limit)
  34.     int cmd;
  35.     long limit;
  36. {
  37.     return 0;
  38. }
  39.  
  40. #endif
  41.  
  42.