Xstat.c 582 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include <sys/types.h>
  2. #include <sys/stat.h>
  3. static Xcvt();
  4. int
  5. stat(path, buf)
  6. char *path;
  7. struct stat *buf;
  8. {
  9. char Xbuf[100];
  10. int retval;
  11. retval = _stat(path, Xbuf);
  12. Xcvt(Xbuf, (char *)buf);
  13. return retval;
  14. }
  15. int
  16. fstat(fd, buf)
  17. int fd;
  18. struct stat *buf;
  19. {
  20. char Xbuf[100];
  21. int retval;
  22. retval = __fstat(fd, Xbuf);
  23. Xcvt(Xbuf, (char *)buf);
  24. return retval;
  25. }
  26. static
  27. Xcvt(buf, statbuf)
  28. char *buf, *statbuf;
  29. {
  30. register char *s, *t;
  31. register int i;
  32. s = buf; t = statbuf;
  33. for (i = 14; i; i--) *t++ = *s++;
  34. *t++ = 0; *t++ = 0;
  35. for (i = 16; i; i--) *t++ = *s++;
  36. }