Thread View: comp.unix.bsd
1 messages
1 total messages
Started by H. Murakami
Mon, 01 Feb 1993 14:38
Problem with the low level I/O.
Author: H. Murakami
Date: Mon, 01 Feb 1993 14:38
Date: Mon, 01 Feb 1993 14:38
112 lines
3376 bytes
3376 bytes
I found, that the 386bsd0.1
The I/O function read()
cannot work with the large buffer size
for the raw device.
Instead it just returns the size it actually read,
The console message appeares saying that
"Out of range, cannot happen? Device not configured"
I have Sony workstation, it can read or write
to the disks or tapes with very large buffer
size I/O operation.
For example,
% tar cvfb /dev/rmt0 10000
I wonder, if this ("Device not configured" etc.)
is a bug or specification of POSIX.
Script started on Sun Jan 24 13:05:16 1993
%
% gcc -DNSECT=100 b.c
% a.out
Success.
%
% gcc -DNSECT=110 b.c
% a.out
Success.
%
% gcc -DNSECT=120 b.c
% a.out
Success.
%
% gcc -DNSECT=125 b.c
% a.out
Success.
%
% gcc -DNSECT=126 b.c
% a.out
Out of range, cannot happen? Device not configured
%
% gcc -DNSECT=127 b.c
% a.out
Out of range, cannot happen? Device not configured
%
% gcc -DNSECT=130 b.c
% a.out
Out of range, cannot happen? Device not configured
%
% cat b.c
/* Start of sample program. */
#define DEVICE "/dev/ras0c" /* SCSI Raw device to be tested. */
#include <stdio.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/times.h>
#define MAXSECT 500
#define NB (512*MAXSECT)
static char buf[NB];
main()
{
int d;
int rtn;
int size;
if ((d=open(DEVICE, O_RDONLY, 0444))<=0) {
fprintf(stderr, "Device open error.\n");
exit(1); }
size = 512 * NSECT;
if (size > NB) {
fprintf(stderr, "NSECT too large. size > NB.\n");
exit(2); }
rtn = read(d, buf, size);
if(rtn <=0) {
extern int errno;
perror("");
exit(3);
}
fprintf(stderr, "Success.\n");
close(d);
}
/* THE END. */
% exit
% exit
Script done on Sun Jan 24 13:06:21 1993
PS.
If I changed the #define DEVICE to the raw IDE drive like /dev/rwd0a,
the limit of NSECT with success goes up was observed, however,
if it is raised somevalue between 200 and 300, the system hangs up anyway.
Wmmm.... this trouble may be related to the hang up
when mallocing by many processes.
Does this bug relates to the limitation of the kernel must reside
below a mega bytes?
Hiroshi Murakami
mhiroshi@tansei.cc.u-tokyo.ac.jp
hiroshi@teine.chem2.hokudai.ac.jp
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads