* fhandler.cc (fhandler_base::fcntl): Setting flags in F_SETFL
branch according to Linux documentation.
This commit is contained in:
parent
1eb14bae8c
commit
38a1798645
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Oct 23 22:27:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler.cc (fhandler_base::fcntl): Setting flags in F_SETFL
|
||||||
|
branch according to Linux documentation.
|
||||||
|
|
||||||
Mon Oct 23 21:43:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
Mon Oct 23 21:43:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fcntl.cc (_fcntl): Rearrange as wrapper function. Move all
|
* fcntl.cc (_fcntl): Rearrange as wrapper function. Move all
|
||||||
|
|
|
@ -1001,8 +1001,6 @@ int fhandler_base::fcntl (int cmd, void *arg)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
/*int temp = 0;*/
|
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case F_GETFD:
|
case F_GETFD:
|
||||||
|
@ -1016,16 +1014,19 @@ int fhandler_base::fcntl (int cmd, void *arg)
|
||||||
res = get_flags ();
|
res = get_flags ();
|
||||||
break;
|
break;
|
||||||
case F_SETFL:
|
case F_SETFL:
|
||||||
/* Only O_APPEND, O_NONBLOCK and O_ASYNC may be set. */
|
{
|
||||||
/*
|
/*
|
||||||
if (arg & O_RDONLY)
|
* Only O_APPEND, O_ASYNC and O_NONBLOCK are allowed.
|
||||||
temp |= GENERIC_READ;
|
* Each other flag will be ignored.
|
||||||
if (arg & O_WRONLY)
|
* Since O_ASYNC isn't defined in fcntl.h it's currently
|
||||||
temp |= GENERIC_WRITE;
|
* ignored as well.
|
||||||
syscall_printf ("fcntl (F_SETFL, %d)", (int) arg);
|
* There's no functionality at all, so...
|
||||||
set_access (temp);
|
*/
|
||||||
*/
|
int flags = get_flags ();
|
||||||
set_flags ((int) arg);
|
flags &= ~(O_APPEND | O_NONBLOCK);
|
||||||
|
flags |= ((int) arg & (O_APPEND | O_NONBLOCK));
|
||||||
|
set_flags (flags);
|
||||||
|
}
|
||||||
res = 0;
|
res = 0;
|
||||||
break;
|
break;
|
||||||
case F_GETLK:
|
case F_GETLK:
|
||||||
|
|
Loading…
Reference in New Issue