The Samba-Bugzilla – Attachment 5027 Details for
Bug 6942
Avoid fragmentation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Sample client program leading to fragmented files
fragementing.c (text/x-csrc), 730 bytes, created by
Olaf Flebbe
on 2009-11-30 10:50:58 UTC
(
hide
)
Description:
Sample client program leading to fragmented files
Filename:
MIME Type:
Creator:
Olaf Flebbe
Created:
2009-11-30 10:50:58 UTC
Size:
730 bytes
patch
obsolete
>#include <io.h> >#include <fcntl.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <stdio.h> >#include <stdlib.h> >#include <time.h> > > >int main( int argc, char *argv[]) { > int i; > char *buf; > int fd; > clock_t start, stop; > > if (argc < 2) { > fprintf( stderr, "need filename\n"); > exit(1); > } > start = clock(); > > buf= (char*) malloc( 12089); > fd = _open( argv[1], _O_RDWR| _O_CREAT, _S_IWRITE); > if (fd <= 0) { > fprintf( stderr, "could not open file\n"); > exit(1); > } > > > for ( i = 0; i < 1000; i++) { > if (12089 != _write( fd, buf, 12089)) { > fprintf( stderr, "disk full\n"); > exit(1); > } > } > _close(fd); > stop = clock(); > printf( "%lf sec\n", (stop -start)*1.0/CLOCKS_PER_SEC); >}
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 6942
: 5027 |
5028
|
5032
|
5033
|
5065
|
5066
|
5312
|
5313
|
5314
|
5315
|
5317
|
5359
|
5360