Browse Source

detect sendfile on Linux with glibc

master
Felix von Leitner 17 years ago
parent
commit
551bcc2f60
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      trysendfile.c

+ 3
- 0
trysendfile.c View File

@ -59,6 +59,8 @@ int main() {
#elif defined(__linux__)
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <unistd.h>
#if defined(__GLIBC__)
#include <sys/sendfile.h>
#elif defined(__dietlibc__)
@ -67,6 +69,7 @@ int main() {
#include <linux/unistd.h>
_syscall4(int,sendfile,int,out,int,in,long *,offset,unsigned long,count)
#endif
#include <stdio.h>
int main() {
int fd=open("havesendfile.c",0);


Loading…
Cancel
Save