[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OT: open syscall wrapper - is this bug free ?



Hi folks.

Sorry for this OT, but this list is the closer i get!

I am in need for writing an open syscall wrapper. Since i do not want to
deal with stdargs my approach went like this:

#include <fcntl.h>

int
apx_open(const char *path, int flags, mode_t mode)
{
	return flags & CREAT ? open(path, flags, mode) : open(path, flags);
}

/* Prototype */

extern int apx_open(const char *, int, ...);

I wonder if this is perfectly correct? I mean, should i face side
effects or this is bug free?

Thanks for your time and cooperation.
best regards