예제 #1
0
 int stat(const char *name, void *st)
{
#if HAVE___XSTAT
	return __xstat(0, name, st);
#else
	if (smbw_path(name)) {
		return smbw_stat(name, st);
	}
	return real_stat(name, st);
#endif
}
예제 #2
0
파일: wrapped.c 프로젝트: hynnet/ralink_sdk
int lstat(char *name, void *st)
{
#if HAVE___LXSTAT
    return __lxstat(0, name, st);
#else
    if (smbw_path(name)) {
        return smbw_stat(name, st);
    }
    return real_lstat(name, st);
#endif
}
예제 #3
0
파일: wrapped.c 프로젝트: hynnet/ralink_sdk
int __lxstat(int vers, char *name, void *st)
{
    double xx[32];
    int ret;

    if (smbw_path(name)) {
        return smbw_stat(name, st);
    }

    ret = real_lstat(name, xx);
    xstat_convert(vers, st, xx);
    return ret;
}
예제 #4
0
파일: wrapper.c 프로젝트: AllardJ/Tomato
int lstat64(const char *name, struct stat64 *st64)
{
        check_init("lstat64");
        
	if (smbw_path((char *) name)) {
                struct SMBW_stat statbuf;
		int ret = smbw_stat((char *) name, &statbuf);
		stat64_convert(&statbuf, st64);
		return ret;
	}
        
        return (* smbw_libc.lstat64)((char *) name, st64);
}
예제 #5
0
파일: wrapper.c 프로젝트: AllardJ/Tomato
int stat(const char *name, struct stat *st)
{
        check_init("stat");
        
	if (smbw_path((char *) name)) {
                struct SMBW_stat statbuf;
		int ret = smbw_stat((char *) name, &statbuf);
                stat_convert(&statbuf, st);
                return ret;
	}
        
        return (* smbw_libc.stat)((char *) name, st);
}
예제 #6
0
파일: smbw.c 프로젝트: AllardJ/Tomato
/***************************************************** 
a wrapper for readlink() - needed for correct errno setting
*******************************************************/
int smbw_readlink(const char *fname, char *buf, size_t bufsize)
{
	struct SMBW_stat st;
	int ret;

        SMBW_INIT();

	ret = smbw_stat(fname, &st);
	if (ret != 0) {
		return -1;
	}
	
	/* it exists - say it isn't a link */
	errno = EINVAL;
	return -1;
}
예제 #7
0
파일: smbw.c 프로젝트: livebox/livebox2
/***************************************************** 
a wrapper for realink() - needed for correct errno setting
*******************************************************/
int smbw_readlink(const char *path, char *buf, size_t bufsize)
{
	struct stat st;
	int ret;

	ret = smbw_stat(path, &st);
	if (ret != 0) {
		DEBUG(4,("readlink(%s) failed\n", path));
		return -1;
	}
	
	/* it exists - say it isn't a link */
	DEBUG(4,("readlink(%s) not a link\n", path));

	errno = EINVAL;
	return -1;
}
예제 #8
0
파일: smbw.c 프로젝트: livebox/livebox2
/***************************************************** 
a wrapper for access()
*******************************************************/
int smbw_access(const char *name, int mode)
{
	struct stat st;

	DEBUG(4,("smbw_access(%s, 0x%x)\n", name, mode));

	if (smbw_stat(name, &st)) return -1;

	if (((mode & R_OK) && !(st.st_mode & S_IRUSR)) ||
	    ((mode & W_OK) && !(st.st_mode & S_IWUSR)) ||
	    ((mode & X_OK) && !(st.st_mode & S_IXUSR))) {
		errno = EACCES;
		return -1;
	}
	
	return 0;
}
예제 #9
0
파일: smbw.c 프로젝트: AllardJ/Tomato
/***************************************************** 
a wrapper for access()
*******************************************************/
int smbw_access(const char *name, int mode)
{
	struct SMBW_stat st;

        SMBW_INIT();

	if (smbw_stat(name, &st)) return -1;

	if (((mode & R_OK) && !(st.s_mode & S_IRUSR)) ||
	    ((mode & W_OK) && !(st.s_mode & S_IWUSR)) ||
	    ((mode & X_OK) && !(st.s_mode & S_IXUSR))) {
		errno = EACCES;
		return -1;
	}
	
	return 0;
}