Changeset 3880:0a3a7d8ca0f2 in roaraudio for libroaross


Ignore:
Timestamp:
05/21/10 11:22:00 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

dummy implemented stat(), fstat(), lstat()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroaross/libroaross.c

    r3879 r3880  
    168168 int     (*open64)(const char *__file, int __oflag, ...); 
    169169 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); 
    170173} _os; 
    171174 
     
    276279 _os.open64 = dlsym(REAL_LIBC, "open64"); 
    277280 _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"); 
    278284} 
    279285 
     
    18691875 
    18701876// ------------------------------------- 
     1877// emulated *stat*() functions follow: 
     1878// ------------------------------------- 
     1879 
     1880int 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 
     1893int 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 
     1906int 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// ------------------------------------- 
    18711917// emulated stdio functions follow: 
    18721918// ------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.