@@ -39,6 +39,7 @@ const arch_bits = switch (native_arch) {
39
39
.riscv64 = > @import ("linux/riscv64.zig" ),
40
40
.sparc64 = > @import ("linux/sparc64.zig" ),
41
41
.loongarch64 = > @import ("linux/loongarch64.zig" ),
42
+ .m68k = > @import ("linux/m68k.zig" ),
42
43
.mips , .mipsel = > @import ("linux/mips.zig" ),
43
44
.mips64 , .mips64el = > @import ("linux/mips64.zig" ),
44
45
.powerpc , .powerpcle = > @import ("linux/powerpc.zig" ),
@@ -92,7 +93,6 @@ pub const Elf_Symndx = arch_bits.Elf_Symndx;
92
93
pub const F = arch_bits .F ;
93
94
pub const Flock = arch_bits .Flock ;
94
95
pub const HWCAP = arch_bits .HWCAP ;
95
- pub const MMAP2_UNIT = arch_bits .MMAP2_UNIT ;
96
96
pub const REG = arch_bits .REG ;
97
97
pub const SC = arch_bits .SC ;
98
98
pub const Stat = arch_bits .Stat ;
@@ -279,7 +279,7 @@ pub const MAP = switch (native_arch) {
279
279
UNINITIALIZED : bool = false ,
280
280
_ : u5 = 0 ,
281
281
},
282
- .hexagon , .s390x = > packed struct (u32 ) {
282
+ .hexagon , .m68k , . s390x = > packed struct (u32 ) {
283
283
TYPE : MAP_TYPE ,
284
284
FIXED : bool = false ,
285
285
ANONYMOUS : bool = false ,
@@ -333,7 +333,7 @@ pub const O = switch (native_arch) {
333
333
SYNC : bool = false ,
334
334
PATH : bool = false ,
335
335
TMPFILE : bool = false ,
336
- _ : u9 = 0 ,
336
+ _23 : u9 = 0 ,
337
337
},
338
338
.x86 , .riscv32 , .riscv64 , .loongarch64 = > packed struct (u32 ) {
339
339
ACCMODE : ACCMODE = .RDONLY ,
@@ -355,7 +355,7 @@ pub const O = switch (native_arch) {
355
355
SYNC : bool = false ,
356
356
PATH : bool = false ,
357
357
TMPFILE : bool = false ,
358
- _ : u9 = 0 ,
358
+ _23 : u9 = 0 ,
359
359
},
360
360
.aarch64 , .aarch64_be , .arm , .armeb , .thumb , .thumbeb = > packed struct (u32 ) {
361
361
ACCMODE : ACCMODE = .RDONLY ,
@@ -377,7 +377,7 @@ pub const O = switch (native_arch) {
377
377
SYNC : bool = false ,
378
378
PATH : bool = false ,
379
379
TMPFILE : bool = false ,
380
- _ : u9 = 0 ,
380
+ _23 : u9 = 0 ,
381
381
},
382
382
.sparc64 = > packed struct (u32 ) {
383
383
ACCMODE : ACCMODE = .RDONLY ,
@@ -402,7 +402,7 @@ pub const O = switch (native_arch) {
402
402
SYNC : bool = false ,
403
403
PATH : bool = false ,
404
404
TMPFILE : bool = false ,
405
- _ : u6 = 0 ,
405
+ _27 : u6 = 0 ,
406
406
},
407
407
.mips , .mipsel , .mips64 , .mips64el = > packed struct (u32 ) {
408
408
ACCMODE : ACCMODE = .RDONLY ,
@@ -426,7 +426,7 @@ pub const O = switch (native_arch) {
426
426
_20 : u1 = 0 ,
427
427
PATH : bool = false ,
428
428
TMPFILE : bool = false ,
429
- _ : u9 = 0 ,
429
+ _23 : u9 = 0 ,
430
430
},
431
431
.powerpc , .powerpcle , .powerpc64 , .powerpc64le = > packed struct (u32 ) {
432
432
ACCMODE : ACCMODE = .RDONLY ,
@@ -448,7 +448,7 @@ pub const O = switch (native_arch) {
448
448
SYNC : bool = false ,
449
449
PATH : bool = false ,
450
450
TMPFILE : bool = false ,
451
- _ : u9 = 0 ,
451
+ _23 : u9 = 0 ,
452
452
},
453
453
.hexagon , .s390x = > packed struct (u32 ) {
454
454
ACCMODE : ACCMODE = .RDONLY ,
@@ -467,15 +467,36 @@ pub const O = switch (native_arch) {
467
467
NOFOLLOW : bool = false ,
468
468
NOATIME : bool = false ,
469
469
CLOEXEC : bool = false ,
470
- _17 : u1 = 0 ,
470
+ _20 : u1 = 0 ,
471
471
PATH : bool = false ,
472
- _ : u10 = 0 ,
472
+ _22 : u10 = 0 ,
473
473
474
474
// #define O_RSYNC 04010000
475
475
// #define O_SYNC 04010000
476
476
// #define O_TMPFILE 020200000
477
477
// #define O_NDELAY O_NONBLOCK
478
478
},
479
+ .m68k = > packed struct (u32 ) {
480
+ ACCMODE : ACCMODE = .RDONLY ,
481
+ _2 : u4 = 0 ,
482
+ CREAT : bool = false ,
483
+ EXCL : bool = false ,
484
+ NOCTTY : bool = false ,
485
+ TRUNC : bool = false ,
486
+ APPEND : bool = false ,
487
+ NONBLOCK : bool = false ,
488
+ DSYNC : bool = false ,
489
+ ASYNC : bool = false ,
490
+ DIRECTORY : bool = false ,
491
+ NOFOLLOW : bool = false ,
492
+ DIRECT : bool = false ,
493
+ LARGEFILE : bool = false ,
494
+ NOATIME : bool = false ,
495
+ CLOEXEC : bool = false ,
496
+ _20 : u1 = 0 ,
497
+ PATH : bool = false ,
498
+ _22 : u10 = 0 ,
499
+ },
479
500
else = > @compileError ("missing std.os.linux.O constants for this architecture" ),
480
501
};
481
502
@@ -906,7 +927,7 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: MAP, fd: i32, of
906
927
prot ,
907
928
@as (u32 , @bitCast (flags )),
908
929
@bitCast (@as (isize , fd )),
909
- @truncate (@as (u64 , @bitCast (offset )) / MMAP2_UNIT ),
930
+ @truncate (@as (u64 , @bitCast (offset )) / std . heap . pageSize () ),
910
931
);
911
932
} else {
912
933
// The s390x mmap() syscall existed before Linux supported syscalls with 5+ parameters, so
0 commit comments