From owner-freebsd-bugs Wed Aug 11 6:42: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B602514D33 for ; Wed, 11 Aug 1999 06:42:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id GAA55406; Wed, 11 Aug 1999 06:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 4197A14D2E; Wed, 11 Aug 1999 06:34:22 -0700 (PDT) Message-Id: <19990811133422.4197A14D2E@hub.freebsd.org> Date: Wed, 11 Aug 1999 06:34:22 -0700 (PDT) From: kwchen@lucent.com To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: kern/13075: signal is not posted for async I/O on raw devices Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 13075 >Category: kern >Synopsis: signal is not posted for async I/O on raw devices >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 11 06:40:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: K. Herman Chen >Release: FreeBSD 3.2-RELEASE #6 >Organization: Lucent Technologies >Environment: FreeBSD marlin 3.2-RELEASE FreeBSD 3.2-RELEASE #6: Mon Jul 19 16:16:40 EDT 1999 lin@tampa:/usr/src/sys/compile/SMASH-CS-32 i386 >Description: The following program (~60 lines) does not get a SIGUSR1 when used with a raw device, but does get the signal with a block device. It will wait forever for a signal (pause()); doing "kill -30 " from shell prompt will cause it to execute sigusr1() and display the data it just read and the data seemed correct. BTW, how do I identify a specific AIO job with each signal? Are signals queued in FreeBSD? Thanks very much. #include #include #include #include #include aiocb_t myaiocb; siginfo_t siginfo; char buf[10240]; sig_t sigusr1(int signo) { int i; printf("in sigusr1(), signo = %d\n", signo); printf("aio_error(myaiocb): %d\n", aio_error(&myaiocb)); #if 0 printf("aio buffer after read: %s\n", buf); for (i = 0; i < 500; i++) printf(" %c", buf[i]); printf("\n"); } main(argc, argv) int argc; char** argv; { int rtn; int fd; /* signal is not posted on raw partition, but okay on block device */ fd = open("/dev/rwd0s4e", O_RDONLY); /* fd = open("/dev/wd0s4e", O_RDONLY); this works. */ if (fd < 0) { perror("open failed"); exit(1); } printf("open succeeded ...\n"); signal(SIGUSR1, (sig_t) sigusr1); myaiocb.aio_fildes = fd; myaiocb.aio_buf = buf; myaiocb.aio_nbytes = 2048; myaiocb.aio_sigevent.sigev_notify = SIGEV_SIGNAL; myaiocb.aio_sigevent.sigev_signo = SIGUSR1; myaiocb.aio_sigevent.sigev_value.sival_int = 123; printf("calling aio_read ...\n"); rtn = aio_read(&myaiocb); if (rtn < 0) { perror("aio_read failed"); exit(1); } printf("aio_read succeeded\n"); /* normally get EINPROGRESS */ printf("aio_error(myaiocb): %d\n", aio_error(&myaiocb)); pause(); } >How-To-Repeat: The above program will wait forever for a signal. >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message