public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] fcntl error
@ 2006-05-12 11:22 aditya veer singh
  2006-05-12 12:06 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: aditya veer singh @ 2006-05-12 11:22 UTC (permalink / raw)
  To: ecos-discuss



When I try to set a file descriptor as non blocking using system call:
fcntl(fd, F_SETFL, O_NONBLOCK) it returns an error during call of FILEIO_RETURN.
fd provided for the function is a valid one.

Can someone provide me with few pointers as what can be possibly wrong with the above call?

Thanks in advance,

Aditya 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] fcntl error
  2006-05-12 11:22 [ECOS] fcntl error aditya veer singh
@ 2006-05-12 12:06 ` Andrew Lunn
  2006-05-15  6:07   ` aditya veer singh
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2006-05-12 12:06 UTC (permalink / raw)
  To: aditya veer singh; +Cc: ecos-discuss

On Fri, May 12, 2006 at 05:56:38PM +0630, aditya veer singh wrote:
> 
> 
> When I try to set a file descriptor as non blocking using system call:
> fcntl(fd, F_SETFL, O_NONBLOCK) it returns an error during call of FILEIO_RETURN.
> fd provided for the function is a valid one.
> 
> Can someone provide me with few pointers as what can be possibly wrong with the above call?

The quickest way to understand this is simply single step the function
call and find out where the error occurs. 

Use the source since you have it.

    Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] fcntl error
  2006-05-12 12:06 ` Andrew Lunn
@ 2006-05-15  6:07   ` aditya veer singh
  2006-05-15  9:32     ` [ECOS] " Daniel Néri
  0 siblings, 1 reply; 4+ messages in thread
From: aditya veer singh @ 2006-05-15  6:07 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

On Fri, 12 May 2006 14:06:10 +0200, Andrew Lunn wrote
> On Fri, May 12, 2006 at 05:56:38PM +0630, aditya veer singh wrote:
> > 
> > 
> > When I try to set a file descriptor as non blocking using system call:
> > fcntl(fd, F_SETFL, O_NONBLOCK) it returns an error during call of FILEIO_RETURN.
> > fd provided for the function is a valid one.
> > 
> > Can someone provide me with few pointers as what can be possibly wrong with the
above call?
> 
> The quickest way to understand this is simply single step the function
> call and find out where the error occurs.
> 
> Use the source since you have it.
> 
>     Andrew

What I understand from the code of fcntl is that 
there is no case written for F_SETFL,
only case which is handled is F_DUPFD.
Therefore it returns a value of ENOTSUP.

Can command F_SETFL with O_NONBLOCK be used in eCos or is it a limitation? 
What needs to be done support it?
Is there any other way to get the same result as from fcntl(fd, F_SETFL, O_NONBLOCK) by
using some other functions?

Aditya






-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS]  Re: fcntl error
  2006-05-15  6:07   ` aditya veer singh
@ 2006-05-15  9:32     ` Daniel Néri
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Néri @ 2006-05-15  9:32 UTC (permalink / raw)
  To: ecos-discuss

"aditya veer singh" <adityav@cdotd.ernet.in> writes:

> Is there any other way to get the same result as from
> fcntl(fd, F_SETFL, O_NONBLOCK) by using some other functions?

Yes, you can use ioctl(2) on socket file descriptors:

  int nonblock_enable(int fd) {
     int flag = 1;
     return ioctl(fd, FIONBIO, &flag);
  }


Regards,
-- 
Daniel Néri <daniel.neri@sigicom.se>
Sigicom AB, Stockholm, Sweden


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-05-15  9:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-12 11:22 [ECOS] fcntl error aditya veer singh
2006-05-12 12:06 ` Andrew Lunn
2006-05-15  6:07   ` aditya veer singh
2006-05-15  9:32     ` [ECOS] " Daniel Néri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).