Skip to content

Commit

Permalink
Better wrapping of legacy stat/fstat/lstat using stat64 this time
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Aug 27, 2024
1 parent 80e092a commit a49c286
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/wrapped/wrappedlibc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,25 +1253,25 @@ static int FillStatFromStat64(int vers, const struct stat64 *st64, void *st32)

EXPORT int my_stat(char* path, void* buf)
{
struct stat st;
int r = stat(path, &st);
UnalignStat(&st, buf);
struct stat64 st;
int r = stat64(path, &st);
FillStatFromStat64(3, &st, buf);
return r;
}

EXPORT int my_fstat(int fd, void* buf)
{
struct stat st;
int r = fstat(fd, &st);
UnalignStat(&st, buf);
struct stat64 st;
int r = fstat64(fd, &st);
FillStatFromStat64(3, &st, buf);
return r;
}

EXPORT int my_lstat(char* path, void* buf)
{
struct stat st;
int r = lstat(path, &st);
UnalignStat(&st, buf);
struct stat64 st;
int r = lstat64(path, &st);
FillStatFromStat64(3, &st, buf);
return r;
}

Expand Down

0 comments on commit a49c286

Please sign in to comment.