Flips tracking of IPC

Martin Pohlack mp26 at os.inf.tu-dresden.de
Tue May 3 12:42:01 CEST 2005

Tiago Jorge wrote:
>>ok... maybe this is my problem regarding another thread in the hackers 
>>list... can this be solved using "select"?
>>Because i must have a listen socket and a sending socket... so if my l4 
>>server has a socket in a select wainting for input, should it be able to 
>>send throught another socket?
> following my last emails... i've tried with select and it doesn't work also.
> So... before a build a separate server just to relay my messages, is it 
> possible to change the blocking state of a socket.
> I've seen that the l4vfs implementation of fcntl its just a dummy 
> implementation

Well, my fcntl() looks as follows:

int fcntl( int fd, int cmd, ... )
    file_desc_t fdesc;
    int ret;
    long arg;
    struct flock *lock;
    va_list list;

    if (! ft_is_open(fd))
        errno = EBADF;
        return -1;

    fdesc = ft_get_entry(fd);

    if (l4_is_invalid_id(fdesc.server_id))
    { // should not happen
        errno = EBADF;
        return -1;

    lock = NULL;

    va_start( list, cmd );
    switch( cmd )
    case F_GETLK:
    case F_SETLK:
    case F_SETLKW:
        lock = va_arg( list, struct flock * );
    case F_DUPFD:
    case F_SETFD:
    case F_SETFL:
    //case F_SETOWN:
    //case F_SETSIG:
    //case F_SETLEASE:
    //case F_NOTIFY:
        arg = va_arg( list, long );
        // no arg
        arg = 0;
    va_end( list );

    // fixme: we don't need to call the server allways, e.g. for
    //        F_DUPFD which works locally completely! others?

    // now we can call the server
    if (lock)
        // hmm. dice doesn't recognize struct flock definition in fcntl.h
        // ret = l4vfs_fcntl_flock(fdesc.server_id,
        //                         fdesc.object_handle,
        //                         cmd,
        //                         lock,
        //                         sizeof(*lock) );
        LOG("F_GETLK, F_SETLK, F_SETLKW not supported");
        ret = -EINVAL;
        ret = l4vfs_fcntl(fdesc.server_id,
                          (l4_int32_t *) &arg );
    return ret;

I therefore do not consider it to be "dummy".

L4VFS is meant to be extended on a use-case basis, it has grown over the
last 1 1/2 years as other projects utilized it.  Maybe you have to
extend it a little bit.  We gladly accept patches (hint, hint).

L4VFS is not meant as a complete posix compliant multiserver unix

> so my question is... is it possible throught another
> l4vfs method or something in FLIPS to do non-blocking IO in sockets/file 
> descriptors?

You could open a file in nonblocking mode using open(..., O_NONBLOCK) if
the corresponding server supports this.


More information about the l4-hackers mailing list