home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / mc454src.zip / mc-4.5.4.src / os2emx / src / util.c < prev    next >
C/C++ Source or Header  |  1999-01-04  |  2KB  |  94 lines

  1. #include<sys/types.h>
  2. #include<sys/stat.h>
  3. #include<sys/statfs.h>
  4. #include<string.h>
  5. #include<stdlib.h>
  6.  
  7.  
  8. void os2_canon_str(char *s)
  9. { char *p=s;
  10.   while(*s){ if(*s=='\\'&&*(s+1)=='\\')s++;
  11.              *p++=*s++;
  12.            }
  13.   *p=0; 
  14. }
  15.  
  16. int lstat (const char* pathname, struct stat *buffer)
  17. {  int rc = stat (pathname, buffer);
  18.    return rc;
  19. }
  20.  
  21. int link (char *p1, char *p2)
  22. {  return -1;
  23. }
  24.  
  25.  
  26. int mknod (char *path, int mode, int dev)
  27. { return -1;
  28. }
  29.  
  30. int chown (char *path, int owner, int group)
  31. { return 0;
  32. }
  33.  
  34. /* unistd.h */
  35. /* Read the contents of the symbolic link PATH into no more tham
  36.    LEN bytes of BUF. The contents are not null-terminated.
  37.    Return the number of characters read, or -1 for errors */
  38. int readlink (const char* path, char* buf, int len)
  39. { return -1;
  40. }
  41.  
  42. /* unistd.h */
  43. /* __USE_BSD || __USE_XOPEN_EXTENDED */
  44. /* Make a symbolic link to FROM named TO */
  45. int symlink (char *from, char *to)
  46. { return -1;
  47. }
  48.  
  49. /* unistd.h */
  50. /* Make PATH be the root directory (the starting point of absolute paths).
  51.    This call is restricted to the super-user. */
  52. int chroot(const char *path)
  53. { return -1;
  54. }
  55.  
  56. /* sys/stat.h */
  57. /* Create a new FIFO named PATH, with premission bits MODE. */
  58. int mkfifo(const char *path, mode_t mode)
  59. { return -1; }
  60.  
  61. /* unistd.h */
  62. /* Create a new session with the calling process at its leader.
  63.    The process group IDs of the session and the calling process
  64.    are set to the process ID of the calling proces, which is returned. */
  65. pid_t setsid(void)
  66. { return -1; }
  67.  
  68. /* unistd.h */
  69. /* Set the real user ID of the calling process to RUID
  70.    and efective user ID of the calling process to EUID. */
  71. int setreuid (uid_t ruid, uid_t euid)
  72. { return -1; }
  73.  
  74. /* grp.h */
  75. /* __USE_SVID || __USE_BSD || __USE_XOPEN_EXTENDED */
  76. /* Rewind the group-file stream. */
  77. void setgrent(void)
  78. {;} 
  79. /* Close the group-file stream */
  80. void endgrent(void)
  81. {;} 
  82. /* Read a group entry from group-file stream, opening it if necessary. */
  83. struct group *getgrent(void)
  84. { return 0; }
  85.  
  86.  
  87. /* sys/statfs.h */
  88. /* Return information about the filesystem on which FILE resides */
  89. int statfs(const char *file, struct statfs *buf)
  90. { return -1;
  91. }
  92.  
  93.  
  94.