[U-Boot] [PATCH v4 7/8] sandbox: Add flags for open() call

Mike Frysinger vapier at gentoo.org
Thu Feb 16 07:09:05 CET 2012


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: <http://lists.denx.de/pipermail/u-boot/attachments/20120216/a2a481bd/attachment.pgp>


More information about the U-Boot mailing list