mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* strange problem with /dev/isdninfo
@ 2001-03-21 12:53 Joern Heissler
  2001-03-21 13:31 ` Kai Germaschewski
  0 siblings, 1 reply; 2+ messages in thread
From: Joern Heissler @ 2001-03-21 12:53 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

Hello!
I'm new to the Mailinglist.

I've got a strange problem with /dev/isdninfo:

joern:~# cat /dev/isdninfo
idmap:  Hisax...
chmap: 0 1 ...
foo
bar
phone:  ??? ??? ...

--> cat /dev/isdninfo works :-)

Here's the problem:

joern:~# cat <<EOF >cat2.c
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char **argv)
{
	char buf[500];
	int fd;

	if(argc!=2) {
		return(1);
	}
	fd=open(argv[1],O_RDONLY);
	write(1,buf,read(fd,buf,200));
	return(0);
}
EOF
joern:~# gcc -o cat2 -Wall -ansi cat2.c
joern:~# ./cat2 /dev/urandom ---> 200 bytes of random characters. works :-)
joern:~# ./cat2 /dev/isdninfo ---> nothing. 

joern:~# strace ./cat2 /dev/isdninfo
...
open("/dev/isdninfo", O_RDONLY) = 3
read(3, "", 200) = 0
write(1, "", 0) = 0
_exit(0) = ?


Could someone please tell me what's wrong? I (and some other people) do not understand this.
Thanks in advance!


[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: strange problem with /dev/isdninfo
  2001-03-21 12:53 strange problem with /dev/isdninfo Joern Heissler
@ 2001-03-21 13:31 ` Kai Germaschewski
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Germaschewski @ 2001-03-21 13:31 UTC (permalink / raw)
  To: Joern Heissler; +Cc: linux-kernel



On Wed, 21 Mar 2001, Joern Heissler wrote:

> I've got a strange problem with /dev/isdninfo:
> 
> joern:~# cat /dev/isdninfo
> idmap:  Hisax...
> chmap: 0 1 ...
>
> --> cat /dev/isdninfo works :-)
> 
> Here's the problem:
> 
> open("/dev/isdninfo", O_RDONLY) = 3
> read(3, "", 200) = 0
>
> Could someone please tell me what's wrong? I (and some other people) do not understand this.

Well, /dev/isdninfo will only return the info to you if it entirely fits
into the supplied buffer. So, you should try a read with 2048 bytes or so,
and it'll work just fine.

Not that I think that the current behavior is particularly smart, but
that's how things are.

--Kai



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-21 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-21 12:53 strange problem with /dev/isdninfo Joern Heissler
2001-03-21 13:31 ` Kai Germaschewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®