Skip to content

Commit

Permalink
Compile fd_64.c file of POSIX runtime correctly on FreeBSD - append "…
Browse files Browse the repository at this point in the history
…64" suffix

to function names.
  • Loading branch information
arrowd authored and MartinNowack committed Nov 9, 2019
1 parent a5dafcf commit c33beaa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions runtime/POSIX/FreeBSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
// for various typedefs inside FreeBSD headers
#define __BSD_VISIBLE 1

#ifndef INSIDE_FD_64
#define stat64 stat
#endif

#include <sys/syscall.h>

Expand Down Expand Up @@ -435,4 +437,19 @@ struct rlimit64;
#define __NR_numa_setaffinity SYS_numa_setaffinity
#define __NR_MAXSYSCALL SYS_MAXSYSCALL

// we are in fd_64.c, add "64" suffix to its functions
#ifdef INSIDE_FD_64

#define open open64
#define openat openat64
#define lseek lseek64
#define __xstat __xstat64
#define stat stat64
#define __lxstat __lxstat64
#define lstat lstat64
#define __fxstat __fxstat64
#define fstat fstat64

#endif

#endif /* KLEE_FREEBSD_H */
1 change: 1 addition & 0 deletions runtime/POSIX/fd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#endif
#endif

#define INSIDE_FD_64
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include "fd.h"
Expand Down

0 comments on commit c33beaa

Please sign in to comment.