Changeset 3880:0a3a7d8ca0f2 in roaraudio
- Timestamp:
- 05/21/10 11:22:00 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroaross/libroaross.c
r3879 r3880 168 168 int (*open64)(const char *__file, int __oflag, ...); 169 169 int (*creat)(const char *pathname, mode_t mode); 170 int (*stat)(const char *path, struct stat *buf); 171 int (*fstat)(int filedes, struct stat *buf); 172 int (*lstat)(const char *path, struct stat *buf); 170 173 } _os; 171 174 … … 276 279 _os.open64 = dlsym(REAL_LIBC, "open64"); 277 280 _os.creat = dlsym(REAL_LIBC, "creat"); 281 _os.stat = dlsym(REAL_LIBC, "stat"); 282 _os.fstat = dlsym(REAL_LIBC, "fstat"); 283 _os.lstat = dlsym(REAL_LIBC, "lstat"); 278 284 } 279 285 … … 1869 1875 1870 1876 // ------------------------------------- 1877 // emulated *stat*() functions follow: 1878 // ------------------------------------- 1879 1880 int stat(const char *path, struct stat *buf) { 1881 struct devices * ptr; 1882 1883 _init(); 1884 1885 if ( (ptr = _get_device(path)) != NULL ) { 1886 errno = ENOSYS; 1887 return -1; 1888 } 1889 1890 return _os.stat(path, buf); 1891 } 1892 1893 int fstat(int filedes, struct stat *buf) { 1894 struct pointer * pointer; 1895 1896 _init(); 1897 1898 if ( (pointer = _get_pointer_by_fh(filedes)) == NULL ) { 1899 return _os.fstat(filedes, buf); 1900 } 1901 1902 errno = ENOSYS; 1903 return -1; 1904 } 1905 1906 int lstat(const char *path, struct stat *buf) { 1907 _init(); 1908 1909 if ( _get_device(path) != NULL ) { 1910 return stat(path, buf); 1911 } 1912 1913 return _os.lstat(path, buf); 1914 } 1915 1916 // ------------------------------------- 1871 1917 // emulated stdio functions follow: 1872 1918 // -------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.