Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Apr 1996 21:41:47 -0800
From:      "Jordan K. Hubbard" <jkh@time.cdrom.com>
To:        hackers@freebsd.org
Subject:   Any clues as to why this fails?
Message-ID:  <23387.828769307@time.cdrom.com>

next in thread | raw e-mail | index | archive | help
#include <signal.h>
#include <fcntl.h>

void
handler(int sig)
{
    printf("Signal %d received\n", sig);
}

main()
{
    int i, fd;

    signal(SIGIO, handler);

    fd = open("/dev/cuaa1", O_RDONLY | O_NONBLOCK | O_EXCL);
    printf("%d\n", fd);
    i = fcntl(fd, F_GETFL, 0);
    printf("%d\n", i);
    printf("%d\n", fcntl(fd, F_SETFL, i | O_ASYNC));
    printf("%d\n", fcntl(fd, F_SETOWN, getpid())); /* This call returns -1 */
    pause();
}

I've read the man page for fcntl() and it really appears as though
that F_SETOWN call should work.  Any clues as to why not?  This
is a snippet from some code that Thomas Roell sent me, wondering
why this didn't work under *BSD when it did under Linux.

					Jordan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?23387.828769307>