Bug 11499 - set FIOSETOWN option in ioctl() function
Summary: set FIOSETOWN option in ioctl() function
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 6.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-05-18 09:22 UTC by YunQin Huang
Modified: 2008-08-01 16:22 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-30 15:38:47 UTC
Embargoed:


Attachments (Terms of Use)

Description YunQin Huang 2000-05-18 09:22:18 UTC
I wrote a UDP server on Linux systemand used signal-driven
I/O to receive datagram. That is, when a new UDP datagram
arrives, the server program will receive a SIGIO signal from
the kernel.
I wrote such code to prepare for this:
==============================================
    /* set the signal handler */
    sigset(SIGIO, sigio_handler);

    /* set the owner of UDP socket */
    pid = getpid();
    if(ioctl(usock, FIOSETOWN, &pid) < 0){
        perror("ioctl FIOSETOWN");
        exit(1);
    }

    /* set socket as async mode to enable
     * signal driven I/O   */
    if(ioctl(usock, FIOASYNC, &on) < 0){
        perror("ioctl FIOASYNC");
        exit(1);
    }
==============================================
When I ran UDP client and sent UDP datagrams,
the UDP server failed to work. I used tcpdump
and saw that datagrams had been transferred
successfully to the server machine. I sent signal
to UDP server using 'kill -SIGIO' command and
proved that the signal handler worked well.
I copied the source code to the Sun Solaris system
and compiled it. It worked well.
Then I returned back to Linux and changed the
FIOSETOWN of ioctl to SIOCSPGRP of ioctl. Two
options are the same. It failed to work as well.
At last, I changed
   ioctl(usock, FIOSETOWN, &pid)
to
   fcntl(usock, F_SETOWN, pid)
then succeeded.

Therefore, I think there is some bug in implementation
of setting FIOSETOWN option of ioctl() function.

My Linux version: Red Hat Linux 6.0,
kernel is 2.2.5-15 and the CPU is Pentium.

Comment 1 Bugzilla owner 2004-09-30 15:38:47 UTC
Thanks for the bug report. However, Red Hat no longer maintains this version of
the product. Please upgrade to the latest version and open a new bug if the problem
persists.

The Fedora Legacy project (http://fedoralegacy.org/) maintains some older releases, 
and if you believe this bug is interesting to them, please report the problem in
the bug tracker at: http://bugzilla.fedora.us/



Note You need to log in before you can comment on or make changes to this bug.