2004-05-10 20:08:38 +00:00
|
|
|
#define _FILE_OFFSET_BITS 64
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include "io_internal.h"
|
|
|
|
|
|
|
|
int io_readwritefile(int64* d,const char* s) {
|
|
|
|
long fd=open(s,O_RDWR);
|
2023-05-02 12:51:56 +00:00
|
|
|
if (fd != -1) { // gcc -fanalyze false positive
|
|
|
|
*d=fd; // no leak, we return the fd in *d
|
2004-05-10 20:08:38 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|