* [Linux-ia64] How do I enable direct IOs with ia64 ?
@ 2002-08-28 12:09 Jacky Malcles
2002-08-28 14:42 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Jacky Malcles @ 2002-08-28 12:09 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 550 bytes --]
If I run the following piece of code to an ia64 (azusa) I can see that
direct
io are not enabled, but please,
what do i have to do to have them running?
remark: With ia32, this code works fine and I directly get:
------
"test: completed" and the file "infile" is initialized
with ia64, it does not work and I get:
"write infile failed: Invalid argument"
... and the file "infile" is not filled up.
version:
Linux version 2.4.18 (xb@pegtst2) (gcc version 3.1) #8 SMP Wed Aug 7
14:30:09
CEST 2002
compil:
cc -O -D_GNU_SOURCE voyons.c -o voyons
[-- Attachment #2: voyons.c --]
[-- Type: text/plain, Size: 1418 bytes --]
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <sys/fcntl.h>
#include <errno.h>
#define BUFSIZE 8192
#define NBLKS 20
#define LEN 30
#define TRUE 1
void
fillbuf(char *buf, int count, char value)
{
while (count-- > 0) *buf++ = value;
}
int
main(int argc, char *argv[])
{
int bufsize = BUFSIZE; /* Buffer size. Default 8k */
int numblks = NBLKS; /* Number of blocks. Default 20 */
char infile[LEN]; /* Input file. Default "infile" */
int fd1, fd2;
int i, n, offset;
char *buf;
strcpy(infile, "infile"); /* Default input file */
if ((fd1 = open(infile, O_DIRECT|O_RDWR|O_CREAT, 0666)) < 0) {
fprintf(stderr, "open infile: %s\n", strerror(errno));
exit(1);
}
/* Allocate for buf, Create input file */
if ((buf = valloc(bufsize)) == 0) {
fprintf(stderr, "valloc buf: %s\n", strerror(errno));
}
for (i = 0; i < numblks; i++) {
fillbuf(buf, bufsize, 'Z');
if (write(fd1, buf, bufsize) == -1) {
fprintf(stderr, "write infile failed: %s\n",
strerror(errno));
}
}
fprintf(stdout, "test: completed\n");
exit(0);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Linux-ia64] How do I enable direct IOs with ia64 ?
2002-08-28 12:09 [Linux-ia64] How do I enable direct IOs with ia64 ? Jacky Malcles
@ 2002-08-28 14:42 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2002-08-28 14:42 UTC (permalink / raw)
To: linux-ia64
Jacky Malcles <Jacky.Malcles@bull.net> writes:
|> If I run the following piece of code to an ia64 (azusa) I can see that
|> direct
|> io are not enabled, but please,
|> what do i have to do to have them running?
Use getpagesize.
|> compil:
|> cc -O -D_GNU_SOURCE voyons.c -o voyons#include <stdio.h>
|> #include <stdlib.h>
|> #include <unistd.h>
|> #include <signal.h>
|> #include <string.h>
|> #include <sys/fcntl.h>
|> #include <errno.h>
|>
|> #define BUFSIZE 8192
Page size is 16k by default on ia64, but can be as large as 64k.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-08-28 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-28 12:09 [Linux-ia64] How do I enable direct IOs with ia64 ? Jacky Malcles
2002-08-28 14:42 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox