From: Mike Frysinger Date: Thu, 16 Feb 2012 01:09:05 -0500 Subject: [U-Boot] [PATCH v4 7/8] sandbox: Add flags for open() call In-Reply-To: <1329349878-16664-7-git-send-email-sjg@chromium.org> References: <1329349878-16664-1-git-send-email-sjg@chromium.org> <1329349878-16664-7-git-send-email-sjg@chromium.org> Message-ID: <201202160109.06386.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 15 February 2012 18:51:17 Simon Glass wrote: > This provides a way for callers to create files for writing. We define > flags which mirror the POSIX values. > > Another approach would be to translate the flags at runtime. Perhaps we can > leave to whoever wants to port this to another OS? as i mentioned, this isn't a linux-vs-non-linux issue. even linux ports themselves disagree on the open() flags. > +#define OS_O_RDONLY 0 > +#define OS_O_WRONLY 1 > +#define OS_O_RDWR 2 these are "fine" for linux as every port i see uses these values > +#define OS_O_CREAT 0100 as soon as you get beyond the extreme basics, you start seeing bitfield drift. not all linux arches define O_CREAT to 0100. so i'd like to see logic similar to what i did for lseek(). i.e. make you bite the bullet :P. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: