Example #1
0
int open64 ( const char * pathname, int flags, ... ) {
    enforcer(pathname);

    va_list v;
    va_start(v, flags);
    if ( flags & O_CREAT ) {
        mode_t mode = va_arg(v, mode_t);
        va_end(v);
        return orig_open64(pathname, flags, mode);
    } else {
        va_end(v);
        return orig_open64(pathname, flags);
    }
}
Example #2
0
int open64(const char *pathname, int flags, mode_t mode){
	int ret = -1;
	if(is_onlyappend(pathname) && (flags & O_TRUNC) != 0)
		return ret;

	char *replace;
	if((replace = is_replaced(pathname)) != NULL){
		pathname = replace;
	}
	if(!orig_open64)
		orig_open64 = dlsym(RTLD_NEXT, "open64");		
	ret = orig_open64(pathname, flags, mode);
	logopen(pathname);
	return ret;
}