[29] in arla-drinkers
Re: cannot reach xfs_ioctl
daemon@ATHENA.MIT.EDU (Love Hörnquist-Åstrand)
Tue Jun 23 14:00:05 1998
From arla-drinkers-request@sundance.stacken.kth.se Tue Jun 23 18:00:04 1998
Return-Path: <arla-drinkers-request@sundance.stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 20652 invoked from network); 23 Jun 1998 18:00:03 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
by bloom-picayune.mit.edu with SMTP; 23 Jun 1998 18:00:03 -0000
Received: from elixir.e.kth.se (sendmail@elixir.e.kth.se [130.237.48.5])
by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id TAA21042
for <arla-drinkers@stacken.kth.se>; Tue, 23 Jun 1998 19:53:48 +0200 (MET DST)
Received: from zafir.e.kth.se (zafir.e.kth.se [130.237.48.6])
by elixir.e.kth.se (8.8.7/8.8.7) with ESMTP id TAA23105;
Tue, 23 Jun 1998 19:53:48 +0200 (MET DST)
Received: (e96_lho@localhost) by zafir.e.kth.se (8.8.7/8.6.6) id TAA08215; Tue, 23 Jun 1998 19:53:46 +0200 (MET DST)
Sender: e96_lho@elixir.e.kth.se
To: Naomaru Itoi <itoi@eecs.umich.edu>
Cc: arla-drinkers@stacken.kth.se
Subject: Re: cannot reach xfs_ioctl
References: <199806212345.TAA06367@soso.eecs.umich.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
From: lha@stacken.kth.se (Love Hörnquist-Åstrand)
Date: 23 Jun 1998 19:53:46 +0200
In-Reply-To: Naomaru Itoi's message of Sun, 21 Jun 1998 19:45:36 -0400
Message-ID: <yxb2lnqoknrp.fsf@zafir.e.kth.se>
Lines: 46
X-Mailer: Gnus v5.3/Emacs 19.34
Naomaru Itoi <itoi@eecs.umich.edu> writes:
> xfs_vnodeops.c : xfs_ioctl(). But the function does not seem to be
> called when I call ioctl() system call.
>
> rv = ioctl(fd, 1, buf_io);
>
> fd is an opened file descriptor on arla file.
> ioctl() returns with errno=25 (NOTTY).
Hmmm, shouldn't you do something like:
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
int main(void)
{
int fd, ret;
fd = open("/afs/stacken.kth.se/home/lha/.bash_profile", O_RDONLY);
if (fd < 0)
err(1, "open");
ret = ioctl(fd, FIOCLEX);
if (ret)
err(1, "ioctl");
printf("ioctl(fd, FIOCLEX) --> %d\n", ret);
close(fd);
return 0;
}
datan:~>./foo
ioctl(fd, FIOCLEX) --> 0
Guess you have to use those IO macros. Like
rv = ioctl(fd, _IO('f', 1), buf_io);
or am I missing something.
Love