20 lines · cpp
1// REQUIRES: linux2// RUN: %clangxx -O0 -g %s -o %t && %run %t3 4#include <assert.h>5#include <stdlib.h>6#include <sys/stat.h>7 8int main(void) {9 struct stat64 st;10 11 assert(!lstat64("/dev/null", &st));12#if defined(__sun__) && defined(__svr4__)13 assert(S_ISLNK(st.st_mode));14#else15 assert(S_ISCHR(st.st_mode));16#endif17 18 return 0;19}20