Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 3544 Details for
Bug 7237
GCC 3.x fails to build kernel's O_DIRECT correctly on i586 platforms
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
odirect.c
odirect.c (text/plain), 1.74 KB, created by
Michael Best
on 2002-08-29 17:11:02 UTC
(
hide
)
Description:
odirect.c
Filename:
MIME Type:
Creator:
Michael Best
Created:
2002-08-29 17:11:02 UTC
Size:
1.74 KB
patch
obsolete
>/***************************************************************************** > > odirect - tests O_DIRECT > Copyright (C) 2002 Wessel Dankers <wsl@nl.linux.org> > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > >****************************************************************************** > > Compile with: gcc -g -O2 -pipe > >*****************************************************************************/ > >#define _GNU_SOURCE >#include <stdio.h> >#include <unistd.h> >#include <fcntl.h> >#include <malloc.h> > >#define BUFSIZE (1<<22) > >static int fd; > >int main(int argc, char **argv) { > char *s = 0; > int i; > struct stat st; > > if(argc != 2) > return fprintf(stderr, "Filename expected.\n"), 1; > > fd = open(argv[1], O_WRONLY|O_CREAT|O_TRUNC|O_DIRECT|O_LARGEFILE, 0666); > if(fd == -1) > return perror("open()"), 2; > > if(fstat(fd, &st) == -1) > return perror("stat()"), 2; > > s = memalign(st.st_blksize, BUFSIZE); > if(!s) > return perror("memalign()"), 2; > > for(i = 0; i < 128; i++) > if(write(fd, s, BUFSIZE) != BUFSIZE) > return perror("write()"), 2; > > if(close(fd)) > return perror("close()"), 2; > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7237
: 3544