[fpc-pascal] DirectoryExists on FreeBSD 12 problem

AlexeyT aaa5500 at ya.ru
Thu Nov 21 21:55:17 CET 2019


freebsd src is https://github.com/freebsd/freebsd/blob/master/sys/sys/stat.h

it has 2 defines for "stat": usual

struct stat {
     dev_t     st_dev;        /* inode's device */
     ino_t      st_ino;        /* inode's number */
     nlink_t      st_nlink;        /* number of hard links */
*mode_t      st_mode;        /* inode protection mode */*

.....

and additional one for freebsd 11:

#if defined(_WANT_FREEBSD11_STAT) || defined(_KERNEL)
struct freebsd11_stat {
     __uint32_t st_dev;        /* inode's device */
     __uint32_t st_ino;        /* inode's number */
*mode_t      st_mode;        /* inode protection mode */*

....

FPC-- 
https://github.com/graemeg/freepascal/blob/master/rtl/bsd/ostypes.inc#L65

the 1st freebsd type is compatible with FPC (I checked only by list of 
fields and order of fields, w/out checking aligns). the 2nd is NOT 
compatible with FPC. so i wonder, which define freebsd 12 uses??? I 
cannot google it easily.

DirectoryExists reads st_mode item.

-- 
Regards,
Alexey

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20191121/47a2299f/attachment.html>


More information about the fpc-pascal mailing list