home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / pdksh-4.9-src.tgz / tar.out / contrib / pdksh / std / posix / unistd.c < prev    next >
C/C++ Source or Header  |  1996-09-28  |  536b  |  44 lines

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