Skip to content

Commit a3f2ecc

Browse files
valpackettRX14
authored andcommittedJan 2, 2018
Support FreeBSD 12 (64-bit inodes) (#5199)
1 parent c40c292 commit a3f2ecc

File tree

4 files changed

+48
-11
lines changed

4 files changed

+48
-11
lines changed
 

Diff for: ‎src/lib_c/x86_64-portbld-freebsd/c/dirent.cr

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@ lib LibC
44
type DIR = Void
55

66
struct Dirent
7-
d_fileno : UInt
7+
{% if flag?(:"freebsd12.0") %}
8+
d_fileno : ULong
9+
d_off : ULong
10+
{% else %}
11+
d_fileno : UInt
12+
{% end %}
813
d_reclen : UShort
914
d_type : UChar
10-
d_namlen : UChar
15+
{% if flag?(:"freebsd12.0") %}
16+
d_pad0 : UChar
17+
d_namlen : UShort
18+
d_pad1 : UShort
19+
{% else %}
20+
d_namlen : UChar
21+
{% end %}
1122
d_name : StaticArray(Char, 256)
1223
end
1324

Diff for: ‎src/lib_c/x86_64-portbld-freebsd/c/sys/stat.cr

+24-7
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,40 @@ lib LibC
3131
struct Stat
3232
st_dev : DevT
3333
st_ino : InoT
34-
st_mode : ModeT
35-
st_nlink : NlinkT
34+
{% if flag?(:"freebsd12.0") %}
35+
st_nlink : NlinkT
36+
st_mode : ModeT
37+
st_pad0 : UShort
38+
{% else %}
39+
st_mode : ModeT
40+
st_nlink : NlinkT
41+
{% end %}
3642
st_uid : UidT
3743
st_gid : GidT
44+
{% if flag?(:"freebsd12.0") %}
45+
st_pad1 : UInt
46+
{% end %}
3847
st_rdev : DevT
3948
st_atim : Timespec
4049
st_mtim : Timespec
4150
st_ctim : Timespec
51+
{% if flag?(:"freebsd12.0") %}
52+
st_birthtim : Timespec
53+
{% end %}
4254
st_size : OffT
4355
st_blocks : BlkcntT
4456
st_blksize : BlksizeT
4557
st_flags : FflagsT
46-
st_gen : UInt
47-
st_lspare : Int
48-
st_birthtim : Timespec
49-
__reserved_17 : UInt
50-
__reserved_18 : UInt
58+
{% if flag?("freebsd12.0") %}
59+
st_gen : ULong
60+
st_spare : StaticArray(ULong, 10)
61+
{% else %}
62+
st_gen : UInt
63+
st_lspare : Int
64+
st_birthtim : Timespec
65+
__reserved_17 : UInt
66+
__reserved_18 : UInt
67+
{% end %}
5168
end
5269

5370
fun chmod(x0 : Char*, x1 : ModeT) : Int

Diff for: ‎src/lib_c/x86_64-portbld-freebsd/c/sys/types.cr

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ lib LibC
99
alias DevT = UInt
1010
alias GidT = UInt
1111
alias IdT = Long
12-
alias InoT = UInt
12+
{% if flag?(:"freebsd12.0") %}
13+
alias InoT = ULong
14+
{% else %}
15+
alias InoT = UInt
16+
{% end %}
1317
alias ModeT = UShort
14-
alias NlinkT = UShort
18+
{% if flag?(:"freebsd12.0") %}
19+
alias NlinkT = ULong
20+
{% else %}
21+
alias NlinkT = UShort
22+
{% end %}
1523
alias OffT = Long
1624
alias PidT = Int
1725
type PthreadAttrT = Void*

Diff for: ‎src/lib_c/x86_64-unknown-freebsd

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
x86_64-portbld-freebsd

0 commit comments

Comments
 (0)
Please sign in to comment.