| 1 | const std = @import("std"); |
| 2 | const linux = std.os.linux; |
| 3 | const builtin = @import("builtin"); |
| 4 | const arch = builtin.target.cpu.arch; |
| 5 | |
| 6 | comptime { |
| 7 | std.debug.assert(builtin.target.os.tag == .linux); |
| 8 | std.debug.assert(@bitSizeOf(usize) == 64); |
| 9 | } |
| 10 | |
| 11 | pub const errno = struct { |
| 12 | pub const Error = error{ |
| 13 | Unexpected, |
| 14 | EPERM, |
| 15 | ENOENT, |
| 16 | ESRCH, |
| 17 | EINTR, |
| 18 | EIO, |
| 19 | ENXIO, |
| 20 | E2BIG, |
| 21 | ENOEXEC, |
| 22 | EBADF, |
| 23 | ECHILD, |
| 24 | EAGAIN, |
| 25 | ENOMEM, |
| 26 | EACCES, |
| 27 | EFAULT, |
| 28 | ENOTBLK, |
| 29 | EBUSY, |
| 30 | EEXIST, |
| 31 | EXDEV, |
| 32 | ENODEV, |
| 33 | ENOTDIR, |
| 34 | EISDIR, |
| 35 | EINVAL, |
| 36 | ENFILE, |
| 37 | EMFILE, |
| 38 | ENOTTY, |
| 39 | ETXTBSY, |
| 40 | EFBIG, |
| 41 | ENOSPC, |
| 42 | ESPIPE, |
| 43 | EROFS, |
| 44 | EMLINK, |
| 45 | EPIPE, |
| 46 | EDOM, |
| 47 | ERANGE, |
| 48 | EDEADLK, |
| 49 | ENAMETOOLONG, |
| 50 | ENOLCK, |
| 51 | ENOSYS, |
| 52 | ENOTEMPTY, |
| 53 | ELOOP, |
| 54 | ENOMSG, |
| 55 | EIDRM, |
| 56 | ECHRNG, |
| 57 | EL2NSYNC, |
| 58 | EL3HLT, |
| 59 | EL3RST, |
| 60 | ELNRNG, |
| 61 | EUNATCH, |
| 62 | ENOCSI, |
| 63 | EL2HLT, |
| 64 | EBADE, |
| 65 | EBADR, |
| 66 | EXFULL, |
| 67 | ENOANO, |
| 68 | EBADRQC, |
| 69 | EBADSLT, |
| 70 | EDEADLOCK, |
| 71 | EBFONT, |
| 72 | ENOSTR, |
| 73 | ENODATA, |
| 74 | ETIME, |
| 75 | ENOSR, |
| 76 | ENONET, |
| 77 | ENOPKG, |
| 78 | EREMOTE, |
| 79 | ENOLINK, |
| 80 | EADV, |
| 81 | ESRMNT, |
| 82 | ECOMM, |
| 83 | EPROTO, |
| 84 | EMULTIHOP, |
| 85 | EDOTDOT, |
| 86 | EBADMSG, |
| 87 | EOVERFLOW, |
| 88 | ENOTUNIQ, |
| 89 | EBADFD, |
| 90 | EREMCHG, |
| 91 | ELIBACC, |
| 92 | ELIBBAD, |
| 93 | ELIBSCN, |
| 94 | ELIBMAX, |
| 95 | ELIBEXEC, |
| 96 | EILSEQ, |
| 97 | ERESTART, |
| 98 | ESTRPIPE, |
| 99 | EUSERS, |
| 100 | ENOTSOCK, |
| 101 | EDESTADDRREQ, |
| 102 | EMSGSIZE, |
| 103 | EPROTOTYPE, |
| 104 | ENOPROTOOPT, |
| 105 | EPROTONOSUPPORT, |
| 106 | ESOCKTNOSUPPORT, |
| 107 | EOPNOTSUPP, |
| 108 | EPFNOSUPPORT, |
| 109 | EAFNOSUPPORT, |
| 110 | EADDRINUSE, |
| 111 | EADDRNOTAVAIL, |
| 112 | ENETDOWN, |
| 113 | ENETUNREACH, |
| 114 | ENETRESET, |
| 115 | ECONNABORTED, |
| 116 | ECONNRESET, |
| 117 | ENOBUFS, |
| 118 | EISCONN, |
| 119 | ENOTCONN, |
| 120 | ESHUTDOWN, |
| 121 | ETOOMANYREFS, |
| 122 | ETIMEDOUT, |
| 123 | ECONNREFUSED, |
| 124 | EHOSTDOWN, |
| 125 | EHOSTUNREACH, |
| 126 | EALREADY, |
| 127 | EINPROGRESS, |
| 128 | ESTALE, |
| 129 | EUCLEAN, |
| 130 | ENOTNAM, |
| 131 | ENAVAIL, |
| 132 | EISNAM, |
| 133 | EREMOTEIO, |
| 134 | EDQUOT, |
| 135 | ENOMEDIUM, |
| 136 | EMEDIUMTYPE, |
| 137 | ECANCELED, |
| 138 | ENOKEY, |
| 139 | EKEYEXPIRED, |
| 140 | EKEYREVOKED, |
| 141 | EKEYREJECTED, |
| 142 | EOWNERDEAD, |
| 143 | ENOTRECOVERABLE, |
| 144 | ERFKILL, |
| 145 | EHWPOISON, |
| 146 | }; |
| 147 | |
| 148 | pub const Enum = switch (builtin.target.cpu.arch) { |
| 149 | .arc, |
| 150 | .arceb, |
| 151 | .arm, |
| 152 | .armeb, |
| 153 | .aarch64, |
| 154 | .aarch64_be, |
| 155 | .csky, |
| 156 | .hexagon, |
| 157 | .loongarch32, |
| 158 | .loongarch64, |
| 159 | .m68k, |
| 160 | .riscv32, |
| 161 | .riscv32be, |
| 162 | .riscv64, |
| 163 | .riscv64be, |
| 164 | .s390x, |
| 165 | .sparc, |
| 166 | .sparc64, |
| 167 | .x86_16, |
| 168 | .x86, |
| 169 | .x86_64, |
| 170 | .xtensa, |
| 171 | .xtensaeb, |
| 172 | => enum(c_ushort) { |
| 173 | EPERM = 1, |
| 174 | ENOENT = 2, |
| 175 | ESRCH = 3, |
| 176 | EINTR = 4, |
| 177 | EIO = 5, |
| 178 | ENXIO = 6, |
| 179 | E2BIG = 7, |
| 180 | ENOEXEC = 8, |
| 181 | EBADF = 9, |
| 182 | ECHILD = 10, |
| 183 | EAGAIN = 11, |
| 184 | ENOMEM = 12, |
| 185 | EACCES = 13, |
| 186 | EFAULT = 14, |
| 187 | ENOTBLK = 15, |
| 188 | EBUSY = 16, |
| 189 | EEXIST = 17, |
| 190 | EXDEV = 18, |
| 191 | ENODEV = 19, |
| 192 | ENOTDIR = 20, |
| 193 | EISDIR = 21, |
| 194 | EINVAL = 22, |
| 195 | ENFILE = 23, |
| 196 | EMFILE = 24, |
| 197 | ENOTTY = 25, |
| 198 | ETXTBSY = 26, |
| 199 | EFBIG = 27, |
| 200 | ENOSPC = 28, |
| 201 | ESPIPE = 29, |
| 202 | EROFS = 30, |
| 203 | EMLINK = 31, |
| 204 | EPIPE = 32, |
| 205 | EDOM = 33, |
| 206 | ERANGE = 34, |
| 207 | EDEADLK = 35, |
| 208 | ENAMETOOLONG = 36, |
| 209 | ENOLCK = 37, |
| 210 | ENOSYS = 38, |
| 211 | ENOTEMPTY = 39, |
| 212 | ELOOP = 40, |
| 213 | ENOMSG = 42, |
| 214 | EIDRM = 43, |
| 215 | ECHRNG = 44, |
| 216 | EL2NSYNC = 45, |
| 217 | EL3HLT = 46, |
| 218 | EL3RST = 47, |
| 219 | ELNRNG = 48, |
| 220 | EUNATCH = 49, |
| 221 | ENOCSI = 50, |
| 222 | EL2HLT = 51, |
| 223 | EBADE = 52, |
| 224 | EBADR = 53, |
| 225 | EXFULL = 54, |
| 226 | ENOANO = 55, |
| 227 | EBADRQC = 56, |
| 228 | EBADSLT = 57, |
| 229 | EBFONT = 59, |
| 230 | ENOSTR = 60, |
| 231 | ENODATA = 61, |
| 232 | ETIME = 62, |
| 233 | ENOSR = 63, |
| 234 | ENONET = 64, |
| 235 | ENOPKG = 65, |
| 236 | EREMOTE = 66, |
| 237 | ENOLINK = 67, |
| 238 | EADV = 68, |
| 239 | ESRMNT = 69, |
| 240 | ECOMM = 70, |
| 241 | EPROTO = 71, |
| 242 | EMULTIHOP = 72, |
| 243 | EDOTDOT = 73, |
| 244 | EBADMSG = 74, |
| 245 | EOVERFLOW = 75, |
| 246 | ENOTUNIQ = 76, |
| 247 | EBADFD = 77, |
| 248 | EREMCHG = 78, |
| 249 | ELIBACC = 79, |
| 250 | ELIBBAD = 80, |
| 251 | ELIBSCN = 81, |
| 252 | ELIBMAX = 82, |
| 253 | ELIBEXEC = 83, |
| 254 | EILSEQ = 84, |
| 255 | ERESTART = 85, |
| 256 | ESTRPIPE = 86, |
| 257 | EUSERS = 87, |
| 258 | ENOTSOCK = 88, |
| 259 | EDESTADDRREQ = 89, |
| 260 | EMSGSIZE = 90, |
| 261 | EPROTOTYPE = 91, |
| 262 | ENOPROTOOPT = 92, |
| 263 | EPROTONOSUPPORT = 93, |
| 264 | ESOCKTNOSUPPORT = 94, |
| 265 | EOPNOTSUPP = 95, |
| 266 | EPFNOSUPPORT = 96, |
| 267 | EAFNOSUPPORT = 97, |
| 268 | EADDRINUSE = 98, |
| 269 | EADDRNOTAVAIL = 99, |
| 270 | ENETDOWN = 100, |
| 271 | ENETUNREACH = 101, |
| 272 | ENETRESET = 102, |
| 273 | ECONNABORTED = 103, |
| 274 | ECONNRESET = 104, |
| 275 | ENOBUFS = 105, |
| 276 | EISCONN = 106, |
| 277 | ENOTCONN = 107, |
| 278 | ESHUTDOWN = 108, |
| 279 | ETOOMANYREFS = 109, |
| 280 | ETIMEDOUT = 110, |
| 281 | ECONNREFUSED = 111, |
| 282 | EHOSTDOWN = 112, |
| 283 | EHOSTUNREACH = 113, |
| 284 | EALREADY = 114, |
| 285 | EINPROGRESS = 115, |
| 286 | ESTALE = 116, |
| 287 | EUCLEAN = 117, |
| 288 | ENOTNAM = 118, |
| 289 | ENAVAIL = 119, |
| 290 | EISNAM = 120, |
| 291 | EREMOTEIO = 121, |
| 292 | EDQUOT = 122, |
| 293 | ENOMEDIUM = 123, |
| 294 | EMEDIUMTYPE = 124, |
| 295 | ECANCELED = 125, |
| 296 | ENOKEY = 126, |
| 297 | EKEYEXPIRED = 127, |
| 298 | EKEYREVOKED = 128, |
| 299 | EKEYREJECTED = 129, |
| 300 | EOWNERDEAD = 130, |
| 301 | ENOTRECOVERABLE = 131, |
| 302 | ERFKILL = 132, |
| 303 | EHWPOISON = 133, |
| 304 | _, |
| 305 | pub const EWOULDBLOCK: Enum = .EAGAIN; |
| 306 | pub const EDEADLOCK: Enum = .EDEADLK; |
| 307 | pub const ENOTSUP: Enum = .EOPNOTSUPP; |
| 308 | }, |
| 309 | .mips, |
| 310 | .mipsel, |
| 311 | => enum(c_ushort) { |
| 312 | EPERM = 1, |
| 313 | ENOENT = 2, |
| 314 | ESRCH = 3, |
| 315 | EINTR = 4, |
| 316 | EIO = 5, |
| 317 | ENXIO = 6, |
| 318 | E2BIG = 7, |
| 319 | ENOEXEC = 8, |
| 320 | EBADF = 9, |
| 321 | ECHILD = 10, |
| 322 | EAGAIN = 11, |
| 323 | ENOMEM = 12, |
| 324 | EACCES = 13, |
| 325 | EFAULT = 14, |
| 326 | ENOTBLK = 15, |
| 327 | EBUSY = 16, |
| 328 | EEXIST = 17, |
| 329 | EXDEV = 18, |
| 330 | ENODEV = 19, |
| 331 | ENOTDIR = 20, |
| 332 | EISDIR = 21, |
| 333 | EINVAL = 22, |
| 334 | ENFILE = 23, |
| 335 | EMFILE = 24, |
| 336 | ENOTTY = 25, |
| 337 | ETXTBSY = 26, |
| 338 | EFBIG = 27, |
| 339 | ENOSPC = 28, |
| 340 | ESPIPE = 29, |
| 341 | EROFS = 30, |
| 342 | EMLINK = 31, |
| 343 | EPIPE = 32, |
| 344 | EDOM = 33, |
| 345 | ERANGE = 34, |
| 346 | ENOMSG = 35, |
| 347 | EIDRM = 36, |
| 348 | ECHRNG = 37, |
| 349 | EL2NSYNC = 38, |
| 350 | EL3HLT = 39, |
| 351 | EL3RST = 40, |
| 352 | ELNRNG = 41, |
| 353 | EUNATCH = 42, |
| 354 | ENOCSI = 43, |
| 355 | EL2HLT = 44, |
| 356 | EDEADLK = 45, |
| 357 | ENOLCK = 46, |
| 358 | EBADE = 50, |
| 359 | EBADR = 51, |
| 360 | EXFULL = 52, |
| 361 | ENOANO = 53, |
| 362 | EBADRQC = 54, |
| 363 | EBADSLT = 55, |
| 364 | EDEADLOCK = 56, |
| 365 | EBFONT = 59, |
| 366 | ENOSTR = 60, |
| 367 | ENODATA = 61, |
| 368 | ETIME = 62, |
| 369 | ENOSR = 63, |
| 370 | ENONET = 64, |
| 371 | ENOPKG = 65, |
| 372 | EREMOTE = 66, |
| 373 | ENOLINK = 67, |
| 374 | EADV = 68, |
| 375 | ESRMNT = 69, |
| 376 | ECOMM = 70, |
| 377 | EPROTO = 71, |
| 378 | EDOTDOT = 73, |
| 379 | EMULTIHOP = 74, |
| 380 | EBADMSG = 77, |
| 381 | ENAMETOOLONG = 78, |
| 382 | EOVERFLOW = 79, |
| 383 | ENOTUNIQ = 80, |
| 384 | EBADFD = 81, |
| 385 | EREMCHG = 82, |
| 386 | ELIBACC = 83, |
| 387 | ELIBBAD = 84, |
| 388 | ELIBSCN = 85, |
| 389 | ELIBMAX = 86, |
| 390 | ELIBEXEC = 87, |
| 391 | EILSEQ = 88, |
| 392 | ENOSYS = 89, |
| 393 | ELOOP = 90, |
| 394 | ERESTART = 91, |
| 395 | ESTRPIPE = 92, |
| 396 | ENOTEMPTY = 93, |
| 397 | EUSERS = 94, |
| 398 | ENOTSOCK = 95, |
| 399 | EDESTADDRREQ = 96, |
| 400 | EMSGSIZE = 97, |
| 401 | EPROTOTYPE = 98, |
| 402 | ENOPROTOOPT = 99, |
| 403 | EPROTONOSUPPORT = 120, |
| 404 | ESOCKTNOSUPPORT = 121, |
| 405 | EOPNOTSUPP = 122, |
| 406 | EPFNOSUPPORT = 123, |
| 407 | EAFNOSUPPORT = 124, |
| 408 | EADDRINUSE = 125, |
| 409 | EADDRNOTAVAIL = 126, |
| 410 | ENETDOWN = 127, |
| 411 | ENETUNREACH = 128, |
| 412 | ENETRESET = 129, |
| 413 | ECONNABORTED = 130, |
| 414 | ECONNRESET = 131, |
| 415 | ENOBUFS = 132, |
| 416 | EISCONN = 133, |
| 417 | ENOTCONN = 134, |
| 418 | EUCLEAN = 135, |
| 419 | ENOTNAM = 137, |
| 420 | ENAVAIL = 138, |
| 421 | EISNAM = 139, |
| 422 | EREMOTEIO = 140, |
| 423 | ESHUTDOWN = 143, |
| 424 | ETOOMANYREFS = 144, |
| 425 | ETIMEDOUT = 145, |
| 426 | ECONNREFUSED = 146, |
| 427 | EHOSTDOWN = 147, |
| 428 | EHOSTUNREACH = 148, |
| 429 | EALREADY = 149, |
| 430 | EINPROGRESS = 150, |
| 431 | ESTALE = 151, |
| 432 | ECANCELED = 158, |
| 433 | ENOMEDIUM = 159, |
| 434 | EMEDIUMTYPE = 160, |
| 435 | ENOKEY = 161, |
| 436 | EKEYEXPIRED = 162, |
| 437 | EKEYREVOKED = 163, |
| 438 | EKEYREJECTED = 164, |
| 439 | EOWNERDEAD = 165, |
| 440 | ENOTRECOVERABLE = 166, |
| 441 | ERFKILL = 167, |
| 442 | EHWPOISON = 168, |
| 443 | EDQUOT = 1133, |
| 444 | _, |
| 445 | pub const ENOTSUP: Enum = .EOPNOTSUPP; |
| 446 | pub const EWOULDBLOCK: Enum = .EAGAIN; |
| 447 | }, |
| 448 | .mips64, |
| 449 | .mips64el, |
| 450 | => enum(c_ushort) { |
| 451 | EPERM = 1, |
| 452 | ENOENT = 2, |
| 453 | ESRCH = 3, |
| 454 | EINTR = 4, |
| 455 | EIO = 5, |
| 456 | ENXIO = 6, |
| 457 | E2BIG = 7, |
| 458 | ENOEXEC = 8, |
| 459 | EBADF = 9, |
| 460 | ECHILD = 10, |
| 461 | EAGAIN = 11, |
| 462 | ENOMEM = 12, |
| 463 | EACCES = 13, |
| 464 | EFAULT = 14, |
| 465 | ENOTBLK = 15, |
| 466 | EBUSY = 16, |
| 467 | EEXIST = 17, |
| 468 | EXDEV = 18, |
| 469 | ENODEV = 19, |
| 470 | ENOTDIR = 20, |
| 471 | EISDIR = 21, |
| 472 | EINVAL = 22, |
| 473 | ENFILE = 23, |
| 474 | EMFILE = 24, |
| 475 | ENOTTY = 25, |
| 476 | ETXTBSY = 26, |
| 477 | EFBIG = 27, |
| 478 | ENOSPC = 28, |
| 479 | ESPIPE = 29, |
| 480 | EROFS = 30, |
| 481 | EMLINK = 31, |
| 482 | EPIPE = 32, |
| 483 | EDOM = 33, |
| 484 | ERANGE = 34, |
| 485 | ENOMSG = 35, |
| 486 | EIDRM = 36, |
| 487 | ECHRNG = 37, |
| 488 | EL2NSYNC = 38, |
| 489 | EL3HLT = 39, |
| 490 | EL3RST = 40, |
| 491 | ELNRNG = 41, |
| 492 | EUNATCH = 42, |
| 493 | ENOCSI = 43, |
| 494 | EL2HLT = 44, |
| 495 | EDEADLK = 45, |
| 496 | ENOLCK = 46, |
| 497 | EBADE = 50, |
| 498 | EBADR = 51, |
| 499 | EXFULL = 52, |
| 500 | ENOANO = 53, |
| 501 | EBADRQC = 54, |
| 502 | EBADSLT = 55, |
| 503 | EDEADLOCK = 56, |
| 504 | EBFONT = 59, |
| 505 | ENOSTR = 60, |
| 506 | ENODATA = 61, |
| 507 | ETIME = 62, |
| 508 | ENOSR = 63, |
| 509 | ENONET = 64, |
| 510 | ENOPKG = 65, |
| 511 | EREMOTE = 66, |
| 512 | ENOLINK = 67, |
| 513 | EADV = 68, |
| 514 | ESRMNT = 69, |
| 515 | ECOMM = 70, |
| 516 | EPROTO = 71, |
| 517 | EDOTDOT = 73, |
| 518 | EMULTIHOP = 74, |
| 519 | EBADMSG = 77, |
| 520 | ENAMETOOLONG = 78, |
| 521 | EOVERFLOW = 79, |
| 522 | ENOTUNIQ = 80, |
| 523 | EBADFD = 81, |
| 524 | EREMCHG = 82, |
| 525 | ELIBACC = 83, |
| 526 | ELIBBAD = 84, |
| 527 | ELIBSCN = 85, |
| 528 | ELIBMAX = 86, |
| 529 | ELIBEXEC = 87, |
| 530 | EILSEQ = 88, |
| 531 | ENOSYS = 89, |
| 532 | ELOOP = 90, |
| 533 | ERESTART = 91, |
| 534 | ESTRPIPE = 92, |
| 535 | ENOTEMPTY = 93, |
| 536 | EUSERS = 94, |
| 537 | ENOTSOCK = 95, |
| 538 | EDESTADDRREQ = 96, |
| 539 | EMSGSIZE = 97, |
| 540 | EPROTOTYPE = 98, |
| 541 | ENOPROTOOPT = 99, |
| 542 | EPROTONOSUPPORT = 120, |
| 543 | ESOCKTNOSUPPORT = 121, |
| 544 | EOPNOTSUPP = 122, |
| 545 | EPFNOSUPPORT = 123, |
| 546 | EAFNOSUPPORT = 124, |
| 547 | EADDRINUSE = 125, |
| 548 | EADDRNOTAVAIL = 126, |
| 549 | ENETDOWN = 127, |
| 550 | ENETUNREACH = 128, |
| 551 | ENETRESET = 129, |
| 552 | ECONNABORTED = 130, |
| 553 | ECONNRESET = 131, |
| 554 | ENOBUFS = 132, |
| 555 | EISCONN = 133, |
| 556 | ENOTCONN = 134, |
| 557 | EUCLEAN = 135, |
| 558 | ENOTNAM = 137, |
| 559 | ENAVAIL = 138, |
| 560 | EISNAM = 139, |
| 561 | EREMOTEIO = 140, |
| 562 | ESHUTDOWN = 143, |
| 563 | ETOOMANYREFS = 144, |
| 564 | ETIMEDOUT = 145, |
| 565 | ECONNREFUSED = 146, |
| 566 | EHOSTDOWN = 147, |
| 567 | EHOSTUNREACH = 148, |
| 568 | EALREADY = 149, |
| 569 | EINPROGRESS = 150, |
| 570 | ESTALE = 151, |
| 571 | ECANCELED = 158, |
| 572 | ENOMEDIUM = 159, |
| 573 | EMEDIUMTYPE = 160, |
| 574 | ENOKEY = 161, |
| 575 | EKEYEXPIRED = 162, |
| 576 | EKEYREVOKED = 163, |
| 577 | EKEYREJECTED = 164, |
| 578 | EOWNERDEAD = 165, |
| 579 | ENOTRECOVERABLE = 166, |
| 580 | ERFKILL = 167, |
| 581 | EHWPOISON = 168, |
| 582 | EDQUOT = 1133, |
| 583 | _, |
| 584 | pub const ENOTSUP: Enum = .EOPNOTSUPP; |
| 585 | pub const EWOULDBLOCK: Enum = .EAGAIN; |
| 586 | }, |
| 587 | .powerpc, |
| 588 | .powerpcle, |
| 589 | => enum(c_ushort) { |
| 590 | EPERM = 1, |
| 591 | ENOENT = 2, |
| 592 | ESRCH = 3, |
| 593 | EINTR = 4, |
| 594 | EIO = 5, |
| 595 | ENXIO = 6, |
| 596 | E2BIG = 7, |
| 597 | ENOEXEC = 8, |
| 598 | EBADF = 9, |
| 599 | ECHILD = 10, |
| 600 | EAGAIN = 11, |
| 601 | ENOMEM = 12, |
| 602 | EACCES = 13, |
| 603 | EFAULT = 14, |
| 604 | ENOTBLK = 15, |
| 605 | EBUSY = 16, |
| 606 | EEXIST = 17, |
| 607 | EXDEV = 18, |
| 608 | ENODEV = 19, |
| 609 | ENOTDIR = 20, |
| 610 | EISDIR = 21, |
| 611 | EINVAL = 22, |
| 612 | ENFILE = 23, |
| 613 | EMFILE = 24, |
| 614 | ENOTTY = 25, |
| 615 | ETXTBSY = 26, |
| 616 | EFBIG = 27, |
| 617 | ENOSPC = 28, |
| 618 | ESPIPE = 29, |
| 619 | EROFS = 30, |
| 620 | EMLINK = 31, |
| 621 | EPIPE = 32, |
| 622 | EDOM = 33, |
| 623 | ERANGE = 34, |
| 624 | EDEADLK = 35, |
| 625 | ENAMETOOLONG = 36, |
| 626 | ENOLCK = 37, |
| 627 | ENOSYS = 38, |
| 628 | ENOTEMPTY = 39, |
| 629 | ELOOP = 40, |
| 630 | ENOMSG = 42, |
| 631 | EIDRM = 43, |
| 632 | ECHRNG = 44, |
| 633 | EL2NSYNC = 45, |
| 634 | EL3HLT = 46, |
| 635 | EL3RST = 47, |
| 636 | ELNRNG = 48, |
| 637 | EUNATCH = 49, |
| 638 | ENOCSI = 50, |
| 639 | EL2HLT = 51, |
| 640 | EBADE = 52, |
| 641 | EBADR = 53, |
| 642 | EXFULL = 54, |
| 643 | ENOANO = 55, |
| 644 | EBADRQC = 56, |
| 645 | EBADSLT = 57, |
| 646 | EDEADLOCK = 58, |
| 647 | EBFONT = 59, |
| 648 | ENOSTR = 60, |
| 649 | ENODATA = 61, |
| 650 | ETIME = 62, |
| 651 | ENOSR = 63, |
| 652 | ENONET = 64, |
| 653 | ENOPKG = 65, |
| 654 | EREMOTE = 66, |
| 655 | ENOLINK = 67, |
| 656 | EADV = 68, |
| 657 | ESRMNT = 69, |
| 658 | ECOMM = 70, |
| 659 | EPROTO = 71, |
| 660 | EMULTIHOP = 72, |
| 661 | EDOTDOT = 73, |
| 662 | EBADMSG = 74, |
| 663 | EOVERFLOW = 75, |
| 664 | ENOTUNIQ = 76, |
| 665 | EBADFD = 77, |
| 666 | EREMCHG = 78, |
| 667 | ELIBACC = 79, |
| 668 | ELIBBAD = 80, |
| 669 | ELIBSCN = 81, |
| 670 | ELIBMAX = 82, |
| 671 | ELIBEXEC = 83, |
| 672 | EILSEQ = 84, |
| 673 | ERESTART = 85, |
| 674 | ESTRPIPE = 86, |
| 675 | EUSERS = 87, |
| 676 | ENOTSOCK = 88, |
| 677 | EDESTADDRREQ = 89, |
| 678 | EMSGSIZE = 90, |
| 679 | EPROTOTYPE = 91, |
| 680 | ENOPROTOOPT = 92, |
| 681 | EPROTONOSUPPORT = 93, |
| 682 | ESOCKTNOSUPPORT = 94, |
| 683 | EOPNOTSUPP = 95, |
| 684 | EPFNOSUPPORT = 96, |
| 685 | EAFNOSUPPORT = 97, |
| 686 | EADDRINUSE = 98, |
| 687 | EADDRNOTAVAIL = 99, |
| 688 | ENETDOWN = 100, |
| 689 | ENETUNREACH = 101, |
| 690 | ENETRESET = 102, |
| 691 | ECONNABORTED = 103, |
| 692 | ECONNRESET = 104, |
| 693 | ENOBUFS = 105, |
| 694 | EISCONN = 106, |
| 695 | ENOTCONN = 107, |
| 696 | ESHUTDOWN = 108, |
| 697 | ETOOMANYREFS = 109, |
| 698 | ETIMEDOUT = 110, |
| 699 | ECONNREFUSED = 111, |
| 700 | EHOSTDOWN = 112, |
| 701 | EHOSTUNREACH = 113, |
| 702 | EALREADY = 114, |
| 703 | EINPROGRESS = 115, |
| 704 | ESTALE = 116, |
| 705 | EUCLEAN = 117, |
| 706 | ENOTNAM = 118, |
| 707 | ENAVAIL = 119, |
| 708 | EISNAM = 120, |
| 709 | EREMOTEIO = 121, |
| 710 | EDQUOT = 122, |
| 711 | ENOMEDIUM = 123, |
| 712 | EMEDIUMTYPE = 124, |
| 713 | ECANCELED = 125, |
| 714 | ENOKEY = 126, |
| 715 | EKEYEXPIRED = 127, |
| 716 | EKEYREVOKED = 128, |
| 717 | EKEYREJECTED = 129, |
| 718 | EOWNERDEAD = 130, |
| 719 | ENOTRECOVERABLE = 131, |
| 720 | ERFKILL = 132, |
| 721 | EHWPOISON = 133, |
| 722 | _, |
| 723 | pub const EWOULDBLOCK: Enum = .EAGAIN; |
| 724 | pub const ENOTSUP: Enum = .EOPNOTSUPP; |
| 725 | }, |
| 726 | .powerpc64, |
| 727 | .powerpc64le, |
| 728 | => enum(c_ushort) { |
| 729 | EPERM = 1, |
| 730 | ENOENT = 2, |
| 731 | ESRCH = 3, |
| 732 | EINTR = 4, |
| 733 | EIO = 5, |
| 734 | ENXIO = 6, |
| 735 | E2BIG = 7, |
| 736 | ENOEXEC = 8, |
| 737 | EBADF = 9, |
| 738 | ECHILD = 10, |
| 739 | EAGAIN = 11, |
| 740 | ENOMEM = 12, |
| 741 | EACCES = 13, |
| 742 | EFAULT = 14, |
| 743 | ENOTBLK = 15, |
| 744 | EBUSY = 16, |
| 745 | EEXIST = 17, |
| 746 | EXDEV = 18, |
| 747 | ENODEV = 19, |
| 748 | ENOTDIR = 20, |
| 749 | EISDIR = 21, |
| 750 | EINVAL = 22, |
| 751 | ENFILE = 23, |
| 752 | EMFILE = 24, |
| 753 | ENOTTY = 25, |
| 754 | ETXTBSY = 26, |
| 755 | EFBIG = 27, |
| 756 | ENOSPC = 28, |
| 757 | ESPIPE = 29, |
| 758 | EROFS = 30, |
| 759 | EMLINK = 31, |
| 760 | EPIPE = 32, |
| 761 | EDOM = 33, |
| 762 | ERANGE = 34, |
| 763 | EDEADLK = 35, |
| 764 | ENAMETOOLONG = 36, |
| 765 | ENOLCK = 37, |
| 766 | ENOSYS = 38, |
| 767 | ENOTEMPTY = 39, |
| 768 | ELOOP = 40, |
| 769 | ENOMSG = 42, |
| 770 | EIDRM = 43, |
| 771 | ECHRNG = 44, |
| 772 | EL2NSYNC = 45, |
| 773 | EL3HLT = 46, |
| 774 | EL3RST = 47, |
| 775 | ELNRNG = 48, |
| 776 | EUNATCH = 49, |
| 777 | ENOCSI = 50, |
| 778 | EL2HLT = 51, |
| 779 | EBADE = 52, |
| 780 | EBADR = 53, |
| 781 | EXFULL = 54, |
| 782 | ENOANO = 55, |
| 783 | EBADRQC = 56, |
| 784 | EBADSLT = 57, |
| 785 | EDEADLOCK = 58, |
| 786 | EBFONT = 59, |
| 787 | ENOSTR = 60, |
| 788 | ENODATA = 61, |
| 789 | ETIME = 62, |
| 790 | ENOSR = 63, |
| 791 | ENONET = 64, |
| 792 | ENOPKG = 65, |
| 793 | EREMOTE = 66, |
| 794 | ENOLINK = 67, |
| 795 | EADV = 68, |
| 796 | ESRMNT = 69, |
| 797 | ECOMM = 70, |
| 798 | EPROTO = 71, |
| 799 | EMULTIHOP = 72, |
| 800 | EDOTDOT = 73, |
| 801 | EBADMSG = 74, |
| 802 | EOVERFLOW = 75, |
| 803 | ENOTUNIQ = 76, |
| 804 | EBADFD = 77, |
| 805 | EREMCHG = 78, |
| 806 | ELIBACC = 79, |
| 807 | ELIBBAD = 80, |
| 808 | ELIBSCN = 81, |
| 809 | ELIBMAX = 82, |
| 810 | ELIBEXEC = 83, |
| 811 | EILSEQ = 84, |
| 812 | ERESTART = 85, |
| 813 | ESTRPIPE = 86, |
| 814 | EUSERS = 87, |
| 815 | ENOTSOCK = 88, |
| 816 | EDESTADDRREQ = 89, |
| 817 | EMSGSIZE = 90, |
| 818 | EPROTOTYPE = 91, |
| 819 | ENOPROTOOPT = 92, |
| 820 | EPROTONOSUPPORT = 93, |
| 821 | ESOCKTNOSUPPORT = 94, |
| 822 | EOPNOTSUPP = 95, |
| 823 | EPFNOSUPPORT = 96, |
| 824 | EAFNOSUPPORT = 97, |
| 825 | EADDRINUSE = 98, |
| 826 | EADDRNOTAVAIL = 99, |
| 827 | ENETDOWN = 100, |
| 828 | ENETUNREACH = 101, |
| 829 | ENETRESET = 102, |
| 830 | ECONNABORTED = 103, |
| 831 | ECONNRESET = 104, |
| 832 | ENOBUFS = 105, |
| 833 | EISCONN = 106, |
| 834 | ENOTCONN = 107, |
| 835 | ESHUTDOWN = 108, |
| 836 | ETOOMANYREFS = 109, |
| 837 | ETIMEDOUT = 110, |
| 838 | ECONNREFUSED = 111, |
| 839 | EHOSTDOWN = 112, |
| 840 | EHOSTUNREACH = 113, |
| 841 | EALREADY = 114, |
| 842 | EINPROGRESS = 115, |
| 843 | ESTALE = 116, |
| 844 | EUCLEAN = 117, |
| 845 | ENOTNAM = 118, |
| 846 | ENAVAIL = 119, |
| 847 | EISNAM = 120, |
| 848 | EREMOTEIO = 121, |
| 849 | EDQUOT = 122, |
| 850 | ENOMEDIUM = 123, |
| 851 | EMEDIUMTYPE = 124, |
| 852 | ECANCELED = 125, |
| 853 | ENOKEY = 126, |
| 854 | EKEYEXPIRED = 127, |
| 855 | EKEYREVOKED = 128, |
| 856 | EKEYREJECTED = 129, |
| 857 | EOWNERDEAD = 130, |
| 858 | ENOTRECOVERABLE = 131, |
| 859 | ERFKILL = 132, |
| 860 | EHWPOISON = 133, |
| 861 | _, |
| 862 | pub const EWOULDBLOCK: Enum = .EAGAIN; |
| 863 | pub const ENOTSUP: Enum = .EOPNOTSUPP; |
| 864 | }, |
| 865 | .alpha => unreachable, |
| 866 | .microblaze, .microblazeel => unreachable, |
| 867 | .sh, .sheb => unreachable, |
| 868 | // nios2 |
| 869 | // openrisc |
| 870 | // parisc |
| 871 | // um |
| 872 | // @compileError("TODO: " ++ @tagName(v)), |
| 873 | .avr, |
| 874 | .bpfel, |
| 875 | .bpfeb, |
| 876 | .msp430, |
| 877 | .amdgcn, |
| 878 | .thumb, |
| 879 | .thumbeb, |
| 880 | .propeller, |
| 881 | .xcore, |
| 882 | .nvptx, |
| 883 | .nvptx64, |
| 884 | .spirv32, |
| 885 | .spirv64, |
| 886 | .kalimba, |
| 887 | .lanai, |
| 888 | .wasm32, |
| 889 | .wasm64, |
| 890 | .ve, |
| 891 | .or1k, |
| 892 | .hppa, |
| 893 | .hppa64, |
| 894 | .kvx, |
| 895 | => unreachable, |
| 896 | }; |
| 897 | |
| 898 | pub fn byName(name: []const u8) ?Error { |
| 899 | inline for (comptime std.meta.fieldNames(Error)) |field_name| { |
| 900 | if (std.mem.eql(u8, name, field_name)) { |
| 901 | return @field(Error, field_name); |
| 902 | } |
| 903 | } |
| 904 | return null; |
| 905 | } |
| 906 | |
| 907 | comptime { |
| 908 | // assert Enum is sequential |
| 909 | var value: c_ushort = 0; // SUCCESS |
| 910 | for (std.enums.values(Enum)) |val| { |
| 911 | std.debug.assert(@intFromEnum(val) > value); |
| 912 | value = @intFromEnum(val); |
| 913 | } |
| 914 | } |
| 915 | comptime { |
| 916 | // sanity test |
| 917 | std.debug.assert(@intFromEnum(Enum.EPERM) == 1); |
| 918 | } |
| 919 | const list = blk: { |
| 920 | const values = std.enums.values(Enum); |
| 921 | const len = @intFromEnum(values[values.len - 1]) + 1; |
| 922 | var errors: [len]Error = @splat(error.Unexpected); |
| 923 | for (values) |f| errors[@intFromEnum(f)] = @field(Error, @tagName(f)); |
| 924 | const final = errors; |
| 925 | break :blk final; |
| 926 | }; |
| 927 | |
| 928 | pub fn fromInt(code: c_int) Error { |
| 929 | @setRuntimeSafety(false); |
| 930 | if (code >= list.len) return error.Unexpected; |
| 931 | if (code <= 0) return error.Unexpected; |
| 932 | return list[@intCast(code)]; |
| 933 | } |
| 934 | |
| 935 | pub fn fromLibC() c_int { |
| 936 | return libc.__errno_location().*; |
| 937 | } |
| 938 | }; |
| 939 | |
| 940 | pub const eai = struct { |
| 941 | pub const Error = error{ |
| 942 | EAI_BADFLAGS, |
| 943 | EAI_NONAME, |
| 944 | EAI_AGAIN, |
| 945 | EAI_FAIL, |
| 946 | EAI_NODATA, |
| 947 | EAI_FAMILY, |
| 948 | EAI_SOCKTYPE, |
| 949 | EAI_SERVICE, |
| 950 | EAI_MEMORY, |
| 951 | EAI_SYSTEM, |
| 952 | EAI_OVERFLOW, |
| 953 | }; |
| 954 | |
| 955 | pub const Enum = enum(c_int) { |
| 956 | EAI_BADFLAGS = -1, |
| 957 | EAI_NONAME = -2, |
| 958 | EAI_AGAIN = -3, |
| 959 | EAI_FAIL = -4, |
| 960 | EAI_NODATA = -5, |
| 961 | EAI_FAMILY = -6, |
| 962 | EAI_SOCKTYPE = -7, |
| 963 | EAI_SERVICE = -8, |
| 964 | EAI_MEMORY = -10, |
| 965 | EAI_SYSTEM = -11, |
| 966 | EAI_OVERFLOW = -12, |
| 967 | }; |
| 968 | |
| 969 | pub fn fromInt(code: c_int) Error { |
| 970 | return switch (@as(Enum, @enumFromInt(code))) { |
| 971 | .EAI_BADFLAGS => error.EAI_BADFLAGS, |
| 972 | .EAI_NONAME => error.EAI_NONAME, |
| 973 | .EAI_AGAIN => error.EAI_AGAIN, |
| 974 | .EAI_FAIL => error.EAI_FAIL, |
| 975 | .EAI_NODATA => error.EAI_NODATA, |
| 976 | .EAI_FAMILY => error.EAI_FAMILY, |
| 977 | .EAI_SOCKTYPE => error.EAI_SOCKTYPE, |
| 978 | .EAI_SERVICE => error.EAI_SERVICE, |
| 979 | .EAI_MEMORY => error.EAI_MEMORY, |
| 980 | .EAI_SYSTEM => error.EAI_SYSTEM, |
| 981 | .EAI_OVERFLOW => error.EAI_OVERFLOW, |
| 982 | }; |
| 983 | } |
| 984 | }; |
| 985 | |
| 986 | pub const libc = struct { |
| 987 | /// void _Exit(int status); |
| 988 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/_Exit.html |
| 989 | pub extern fn _Exit(status: c_int) noreturn; |
| 990 | |
| 991 | /// void _exit(int status); |
| 992 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/_exit.html |
| 993 | pub extern fn _exit(status: c_int) noreturn; |
| 994 | |
| 995 | /// long a64l(const char *s); |
| 996 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/a64l.html |
| 997 | pub extern fn a64l(s: [*]const u8) c_long; |
| 998 | |
| 999 | /// void abort(void); |
| 1000 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/abort.html |
| 1001 | pub extern fn abort() void; |
| 1002 | |
| 1003 | /// int abs(int i); |
| 1004 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/abs.html |
| 1005 | pub extern fn abs(i: c_int) c_int; |
| 1006 | |
| 1007 | /// int accept(int socket, struct sockaddr *restrict address, socklen_t *restrict address_len); |
| 1008 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/accept.html |
| 1009 | pub extern fn accept(socket: c_int, noalias address: ?*struct_sockaddr, noalias address_len: *socklen_t) c_int; |
| 1010 | |
| 1011 | /// int access(const char *path, int amode); |
| 1012 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/access.html |
| 1013 | pub extern fn access(path: [*:0]const u8, amode: c_int) c_int; |
| 1014 | |
| 1015 | /// double acos(double x); |
| 1016 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/acos.html |
| 1017 | pub extern fn acos(x: f64) f64; |
| 1018 | |
| 1019 | /// float acosf(float x); |
| 1020 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/acosf.html |
| 1021 | pub extern fn acosf(x: f32) f32; |
| 1022 | |
| 1023 | /// double acosh(double x); |
| 1024 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/acosh.html |
| 1025 | pub extern fn acosh(x: f64) f64; |
| 1026 | |
| 1027 | /// float acoshf(float x); |
| 1028 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/acoshf.html |
| 1029 | pub extern fn acoshf(x: f32) f32; |
| 1030 | |
| 1031 | /// long double acoshl(long double x); |
| 1032 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/acoshl.html |
| 1033 | pub extern fn acoshl(x: c_longdouble) c_longdouble; |
| 1034 | |
| 1035 | /// long double acosl(long double x); |
| 1036 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/acosl.html |
| 1037 | pub extern fn acosl(x: c_longdouble) c_longdouble; |
| 1038 | |
| 1039 | /// unsigned alarm(unsigned seconds); |
| 1040 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/alarm.html |
| 1041 | pub extern fn alarm(seconds: c_uint) c_uint; |
| 1042 | |
| 1043 | /// double asin(double x); |
| 1044 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/asin.html |
| 1045 | pub extern fn asin(x: f64) f64; |
| 1046 | |
| 1047 | /// float asinf(float x); |
| 1048 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/asinf.html |
| 1049 | pub extern fn asinf(x: f32) f32; |
| 1050 | |
| 1051 | /// double asinh(double x); |
| 1052 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/asinh.html |
| 1053 | pub extern fn asinh(x: f64) f64; |
| 1054 | |
| 1055 | /// float asinhf(float x); |
| 1056 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/asinhf.html |
| 1057 | pub extern fn asinhf(x: f32) f32; |
| 1058 | |
| 1059 | /// long double asinhl(long double x); |
| 1060 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/asinhl.html |
| 1061 | pub extern fn asinhl(x: c_longdouble) c_longdouble; |
| 1062 | |
| 1063 | /// long double asinl(long double x); |
| 1064 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/asinl.html |
| 1065 | pub extern fn asinl(x: c_longdouble) c_longdouble; |
| 1066 | |
| 1067 | /// double atan(double x); |
| 1068 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atan.html |
| 1069 | pub extern fn atan(x: f64) f64; |
| 1070 | |
| 1071 | /// double atan2(double y, double x); |
| 1072 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atan2.html |
| 1073 | pub extern fn atan2(y: f64, x: f64) f64; |
| 1074 | |
| 1075 | /// float atan2f(float y, float x); |
| 1076 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atan2f.html |
| 1077 | pub extern fn atan2f(y: f32, x: f32) f32; |
| 1078 | |
| 1079 | /// long double atan2l(long double y, long double x); |
| 1080 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atan2l.html |
| 1081 | pub extern fn atan2l(y: c_longdouble, x: c_longdouble) c_longdouble; |
| 1082 | |
| 1083 | /// float atanf(float x); |
| 1084 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atanf.html |
| 1085 | pub extern fn atanf(x: f32) f32; |
| 1086 | |
| 1087 | /// double atanh(double x); |
| 1088 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atanh.html |
| 1089 | pub extern fn atanh(x: f64) f64; |
| 1090 | |
| 1091 | /// float atanhf(float x); |
| 1092 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atanhf.html |
| 1093 | pub extern fn atanhf(x: f32) f32; |
| 1094 | |
| 1095 | /// long double atanhl(long double x); |
| 1096 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atanhl.html |
| 1097 | pub extern fn atanhl(x: c_longdouble) c_longdouble; |
| 1098 | |
| 1099 | /// long double atanl(long double x); |
| 1100 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/atanl.html |
| 1101 | pub extern fn atanl(x: c_longdouble) c_longdouble; |
| 1102 | |
| 1103 | /// int bind(int socket, const struct sockaddr *address, socklen_t address_len); |
| 1104 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/bind.html |
| 1105 | pub extern fn bind(socket: c_int, address: *const struct_sockaddr, address_len: socklen_t) c_int; |
| 1106 | |
| 1107 | /// double cbrt(double x); |
| 1108 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/cbrt.html |
| 1109 | pub extern fn cbrt(x: f64) f64; |
| 1110 | |
| 1111 | /// float cbrtf(float x); |
| 1112 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/cbrtf.html |
| 1113 | pub extern fn cbrtf(x: f32) f32; |
| 1114 | |
| 1115 | /// long double cbrtl(long double x); |
| 1116 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/cbrtl.html |
| 1117 | pub extern fn cbrtl(x: c_longdouble) c_longdouble; |
| 1118 | |
| 1119 | /// double ceil(double x); |
| 1120 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ceil.html |
| 1121 | pub extern fn ceil(x: f64) f64; |
| 1122 | |
| 1123 | /// float ceilf(float x); |
| 1124 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ceilf.html |
| 1125 | pub extern fn ceilf(x: f32) f32; |
| 1126 | |
| 1127 | /// long double ceill(long double x); |
| 1128 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ceill.html |
| 1129 | pub extern fn ceill(x: c_longdouble) c_longdouble; |
| 1130 | |
| 1131 | /// int chdir(const char *path); |
| 1132 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/chdir.html |
| 1133 | pub extern fn chdir(path: [*:0]const u8) c_int; |
| 1134 | |
| 1135 | /// int chmod(const char *path, mode_t mode); |
| 1136 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/chmod.html |
| 1137 | pub extern fn chmod(path: [*:0]const u8, mode: mode_t) c_int; |
| 1138 | |
| 1139 | /// int chown(const char *path, uid_t owner, gid_t group); |
| 1140 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/chown.html |
| 1141 | pub extern fn chown(path: [*:0]const u8, owner: uid_t, group: gid_t) c_int; |
| 1142 | |
| 1143 | /// clock_t clock(void); |
| 1144 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/clock.html |
| 1145 | pub extern fn clock() clock_t; |
| 1146 | |
| 1147 | /// int clock_getcpuclockid(pid_t pid, clockid_t *clock_id); |
| 1148 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/clock_getcpuclockid.html |
| 1149 | pub extern fn clock_getcpuclockid(pid: pid_t, clock_id: *clockid_t) c_int; |
| 1150 | |
| 1151 | /// int clock_getres(clockid_t clock_id, struct timespec *res); |
| 1152 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/clock_getres.html |
| 1153 | pub extern fn clock_getres(clock_id: clockid_t, res: ?*struct_timespec) c_int; |
| 1154 | |
| 1155 | /// int clock_gettime(clockid_t clock_id, struct timespec *tp); |
| 1156 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/clock_gettime.html |
| 1157 | pub extern fn clock_gettime(clock_id: clockid_t, tp: *struct_timespec) c_int; |
| 1158 | |
| 1159 | /// int close(int fildes); |
| 1160 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/close.html |
| 1161 | pub extern fn close(fildes: c_int) c_int; |
| 1162 | |
| 1163 | /// void closelog(void); |
| 1164 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/closelog.html |
| 1165 | pub extern fn closelog() void; |
| 1166 | |
| 1167 | /// int connect(int socket, const struct sockaddr *address, socklen_t address_len); |
| 1168 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/connect.html |
| 1169 | pub extern fn connect(socket: c_int, address: *const struct_sockaddr, address_len: socklen_t) c_int; |
| 1170 | |
| 1171 | /// double copysign(double x, double y); |
| 1172 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/copysign.html |
| 1173 | pub extern fn copysign(x: f64, y: f64) f64; |
| 1174 | |
| 1175 | /// float copysignf(float x, float y); |
| 1176 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/copysignf.html |
| 1177 | pub extern fn copysignf(x: f32, y: f32) f32; |
| 1178 | |
| 1179 | /// long double copysignl(long double x, long double y); |
| 1180 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/copysignl.html |
| 1181 | pub extern fn copysignl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 1182 | |
| 1183 | /// double cos(double x); |
| 1184 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/cos.html |
| 1185 | pub extern fn cos(x: f64) f64; |
| 1186 | |
| 1187 | /// float cosf(float x); |
| 1188 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/cosf.html |
| 1189 | pub extern fn cosf(x: f32) f32; |
| 1190 | |
| 1191 | /// double cosh(double x); |
| 1192 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/cosh.html |
| 1193 | pub extern fn cosh(x: f64) f64; |
| 1194 | |
| 1195 | /// float coshf(float x); |
| 1196 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/coshf.html |
| 1197 | pub extern fn coshf(x: f32) f32; |
| 1198 | |
| 1199 | /// long double coshl(long double x); |
| 1200 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/coshl.html |
| 1201 | pub extern fn coshl(x: c_longdouble) c_longdouble; |
| 1202 | |
| 1203 | /// long double cosl(long double x); |
| 1204 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/cosl.html |
| 1205 | pub extern fn cosl(x: c_longdouble) c_longdouble; |
| 1206 | |
| 1207 | /// div_t div(int numer, int denom); |
| 1208 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/div.html |
| 1209 | pub extern fn div(numer: c_int, denom: c_int) div_t; |
| 1210 | |
| 1211 | /// char *dlerror(void); |
| 1212 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/dlerror.html |
| 1213 | pub extern fn dlerror() ?[*:0]u8; |
| 1214 | |
| 1215 | /// double drand48(void); |
| 1216 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/drand48.html |
| 1217 | pub extern fn drand48() f64; |
| 1218 | |
| 1219 | /// int dup(int fildes); |
| 1220 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/dup.html |
| 1221 | pub extern fn dup(fildes: c_int) c_int; |
| 1222 | |
| 1223 | /// int dup2(int fildes, int fildes2); |
| 1224 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/dup2.html |
| 1225 | pub extern fn dup2(fildes: c_int, fildes2: c_int) c_int; |
| 1226 | |
| 1227 | /// void endgrent(void); |
| 1228 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/endgrent.html |
| 1229 | pub extern fn endgrent() void; |
| 1230 | |
| 1231 | /// void endhostent(void); |
| 1232 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/endhostent.html |
| 1233 | pub extern fn endhostent() void; |
| 1234 | |
| 1235 | /// void endnetent(void); |
| 1236 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/endnetent.html |
| 1237 | pub extern fn endnetent() void; |
| 1238 | |
| 1239 | /// void endprotoent(void); |
| 1240 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/endprotoent.html |
| 1241 | pub extern fn endprotoent() void; |
| 1242 | |
| 1243 | /// void endpwent(void); |
| 1244 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/endpwent.html |
| 1245 | pub extern fn endpwent() void; |
| 1246 | |
| 1247 | /// void endservent(void); |
| 1248 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/endservent.html |
| 1249 | pub extern fn endservent() void; |
| 1250 | |
| 1251 | /// void endutxent(void); |
| 1252 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/endutxent.html |
| 1253 | pub extern fn endutxent() void; |
| 1254 | |
| 1255 | /// double erand48(unsigned short xsubi[3]); |
| 1256 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/erand48.html |
| 1257 | pub extern fn erand48(xsubi: *[3]c_ushort) f64; |
| 1258 | |
| 1259 | /// double erf(double x); |
| 1260 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/erf.html |
| 1261 | pub extern fn erf(x: f64) f64; |
| 1262 | |
| 1263 | /// double erfc(double x); |
| 1264 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/erfc.html |
| 1265 | pub extern fn erfc(x: f64) f64; |
| 1266 | |
| 1267 | /// float erfcf(float x); |
| 1268 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/erfcf.html |
| 1269 | pub extern fn erfcf(x: f32) f32; |
| 1270 | |
| 1271 | /// long double erfcl(long double x); |
| 1272 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/erfcl.html |
| 1273 | pub extern fn erfcl(x: c_longdouble) c_longdouble; |
| 1274 | |
| 1275 | /// float erff(float x); |
| 1276 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/erff.html |
| 1277 | pub extern fn erff(x: f32) f32; |
| 1278 | |
| 1279 | /// long double erfl(long double x); |
| 1280 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/erfl.html |
| 1281 | pub extern fn erfl(x: c_longdouble) c_longdouble; |
| 1282 | |
| 1283 | /// int execvp(const char *file, char *const argv[]); |
| 1284 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/execvp.html |
| 1285 | pub extern fn execvp(file: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int; |
| 1286 | |
| 1287 | /// void exit(int status); |
| 1288 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/exit.html |
| 1289 | pub extern fn exit(status: c_int) noreturn; |
| 1290 | |
| 1291 | /// double exp(double x); |
| 1292 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/exp.html |
| 1293 | pub extern fn exp(x: f64) f64; |
| 1294 | |
| 1295 | /// double exp2(double x); |
| 1296 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/exp2.html |
| 1297 | pub extern fn exp2(x: f64) f64; |
| 1298 | |
| 1299 | /// float exp2f(float x); |
| 1300 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/exp2f.html |
| 1301 | pub extern fn exp2f(x: f32) f32; |
| 1302 | |
| 1303 | /// long double exp2l(long double x); |
| 1304 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/exp2l.html |
| 1305 | pub extern fn exp2l(x: c_longdouble) c_longdouble; |
| 1306 | |
| 1307 | /// float expf(float x); |
| 1308 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/expf.html |
| 1309 | pub extern fn expf(x: f32) f32; |
| 1310 | |
| 1311 | /// long double expl(long double x); |
| 1312 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/expl.html |
| 1313 | pub extern fn expl(x: c_longdouble) c_longdouble; |
| 1314 | |
| 1315 | /// double expm1(double x); |
| 1316 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/expm1.html |
| 1317 | pub extern fn expm1(x: f64) f64; |
| 1318 | |
| 1319 | /// float expm1f(float x); |
| 1320 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/expm1f.html |
| 1321 | pub extern fn expm1f(x: f32) f32; |
| 1322 | |
| 1323 | /// long double expm1l(long double x); |
| 1324 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/expm1l.html |
| 1325 | pub extern fn expm1l(x: c_longdouble) c_longdouble; |
| 1326 | |
| 1327 | /// double fabs(double x); |
| 1328 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fabs.html |
| 1329 | pub extern fn fabs(x: f64) f64; |
| 1330 | |
| 1331 | /// float fabsf(float x); |
| 1332 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fabsf.html |
| 1333 | pub extern fn fabsf(x: f32) f32; |
| 1334 | |
| 1335 | /// long double fabsl(long double x); |
| 1336 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fabsl.html |
| 1337 | pub extern fn fabsl(x: c_longdouble) c_longdouble; |
| 1338 | |
| 1339 | /// int faccessat(int fd, const char *path, int amode, int flag); |
| 1340 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/faccessat.html |
| 1341 | pub extern fn faccessat(fd: c_int, path: [*:0]const u8, amode: c_int, flag: c_int) c_int; |
| 1342 | |
| 1343 | /// int fchdir(int fildes); |
| 1344 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fchdir.html |
| 1345 | pub extern fn fchdir(fildes: c_int) c_int; |
| 1346 | |
| 1347 | /// int fchmod(int fildes, mode_t mode); |
| 1348 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fchmod.html |
| 1349 | pub extern fn fchmod(fildes: c_int, mode: mode_t) c_int; |
| 1350 | |
| 1351 | /// int fchmodat(int fd, const char *path, mode_t mode, int flag); |
| 1352 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fchmodat.html |
| 1353 | pub extern fn fchmodat(fd: c_int, path: [*:0]const u8, mode: mode_t, flag: c_int) c_int; |
| 1354 | |
| 1355 | /// int fchown(int fildes, uid_t owner, gid_t group); |
| 1356 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fchown.html |
| 1357 | pub extern fn fchown(fildes: c_int, owner: uid_t, group: gid_t) c_int; |
| 1358 | |
| 1359 | /// int fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag); |
| 1360 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fchownat.html |
| 1361 | pub extern fn fchownat(fd: c_int, path: [*:0]const u8, owner: uid_t, group: gid_t, flag: c_int) c_int; |
| 1362 | |
| 1363 | /// int fdatasync(int fildes); |
| 1364 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fdatasync.html |
| 1365 | pub extern fn fdatasync(fildes: c_int) c_int; |
| 1366 | |
| 1367 | /// double fdim(double x, double y); |
| 1368 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fdim.html |
| 1369 | pub extern fn fdim(x: f64, y: f64) f64; |
| 1370 | |
| 1371 | /// float fdimf(float x, float y); |
| 1372 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fdimf.html |
| 1373 | pub extern fn fdimf(x: f32, y: f32) f32; |
| 1374 | |
| 1375 | /// long double fdiml(long double x, long double y); |
| 1376 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fdiml.html |
| 1377 | pub extern fn fdiml(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 1378 | |
| 1379 | /// int fegetround(void); |
| 1380 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fegetround.html |
| 1381 | pub extern fn fegetround() c_int; |
| 1382 | |
| 1383 | /// int fesetround(int round); |
| 1384 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fesetround.html |
| 1385 | pub extern fn fesetround(round: c_int) c_int; |
| 1386 | |
| 1387 | /// int fetestexcept(int excepts); |
| 1388 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fetestexcept.html |
| 1389 | pub extern fn fetestexcept(excepts: c_int) c_int; |
| 1390 | |
| 1391 | /// int ffs(int i); |
| 1392 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ffs.html |
| 1393 | pub extern fn ffs(i: c_int) c_int; |
| 1394 | |
| 1395 | /// double floor(double x); |
| 1396 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/floor.html |
| 1397 | pub extern fn floor(x: f64) f64; |
| 1398 | |
| 1399 | /// float floorf(float x); |
| 1400 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/floorf.html |
| 1401 | pub extern fn floorf(x: f32) f32; |
| 1402 | |
| 1403 | /// long double floorl(long double x); |
| 1404 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/floorl.html |
| 1405 | pub extern fn floorl(x: c_longdouble) c_longdouble; |
| 1406 | |
| 1407 | /// double fma(double x, double y, double z); |
| 1408 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fma.html |
| 1409 | pub extern fn fma(x: f64, y: f64, z: f64) f64; |
| 1410 | |
| 1411 | /// float fmaf(float x, float y, float z); |
| 1412 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmaf.html |
| 1413 | pub extern fn fmaf(x: f32, y: f32, z: f32) f32; |
| 1414 | |
| 1415 | /// long double fmal(long double x, long double y, long double z); |
| 1416 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmal.html |
| 1417 | pub extern fn fmal(x: c_longdouble, y: c_longdouble, z: c_longdouble) c_longdouble; |
| 1418 | |
| 1419 | /// double fmax(double x, double y); |
| 1420 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmax.html |
| 1421 | pub extern fn fmax(x: f64, y: f64) f64; |
| 1422 | |
| 1423 | /// float fmaxf(float x, float y); |
| 1424 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmaxf.html |
| 1425 | pub extern fn fmaxf(x: f32, y: f32) f32; |
| 1426 | |
| 1427 | /// long double fmaxl(long double x, long double y); |
| 1428 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmaxl.html |
| 1429 | pub extern fn fmaxl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 1430 | |
| 1431 | /// double fmin(double x, double y); |
| 1432 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmin.html |
| 1433 | pub extern fn fmin(x: f64, y: f64) f64; |
| 1434 | |
| 1435 | /// float fminf(float x, float y); |
| 1436 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fminf.html |
| 1437 | pub extern fn fminf(x: f32, y: f32) f32; |
| 1438 | |
| 1439 | /// long double fminl(long double x, long double y); |
| 1440 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fminl.html |
| 1441 | pub extern fn fminl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 1442 | |
| 1443 | /// double fmod(double x, double y); |
| 1444 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmod.html |
| 1445 | pub extern fn fmod(x: f64, y: f64) f64; |
| 1446 | |
| 1447 | /// float fmodf(float x, float y); |
| 1448 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmodf.html |
| 1449 | pub extern fn fmodf(x: f32, y: f32) f32; |
| 1450 | |
| 1451 | /// long double fmodl(long double x, long double y); |
| 1452 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fmodl.html |
| 1453 | pub extern fn fmodl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 1454 | |
| 1455 | /// pid_t fork(void); |
| 1456 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fork.html |
| 1457 | pub extern fn fork() pid_t; |
| 1458 | |
| 1459 | /// long fpathconf(int fildes, int name); |
| 1460 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fpathconf.html |
| 1461 | pub extern fn fpathconf(fildes: c_int, name: c_int) c_long; |
| 1462 | |
| 1463 | /// void free(void *ptr); |
| 1464 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/free.html |
| 1465 | pub extern fn free(ptr: ?*anyopaque) void; |
| 1466 | |
| 1467 | /// void freeaddrinfo(struct addrinfo *ai); |
| 1468 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/freeaddrinfo.html |
| 1469 | pub extern fn freeaddrinfo(ai: *const struct_addrinfo) void; |
| 1470 | |
| 1471 | /// void freelocale(locale_t locobj); |
| 1472 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/freelocale.html |
| 1473 | pub extern fn freelocale(locobj: locale_t) void; |
| 1474 | |
| 1475 | /// double frexp(double num, int *exp); |
| 1476 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/frexp.html |
| 1477 | pub extern fn frexp(x: f64, exp: *c_int) f64; |
| 1478 | |
| 1479 | /// float frexpf(float num, int *exp); |
| 1480 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/frexpf.html |
| 1481 | pub extern fn frexpf(x: f32, exp: *c_int) f32; |
| 1482 | |
| 1483 | /// long double frexpl(long double num, int *exp); |
| 1484 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/frexpl.html |
| 1485 | pub extern fn frexpl(x: c_longdouble, exp: *c_int) c_longdouble; |
| 1486 | |
| 1487 | /// int fstat(int fildes, struct stat *buf); |
| 1488 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fstat.html |
| 1489 | pub extern fn fstat(fd: c_int, buf: *struct_stat) c_int; |
| 1490 | |
| 1491 | /// int fstatat(int fd, const char *restrict path, struct stat *restrict buf, int flag); |
| 1492 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fstatat.html |
| 1493 | pub extern fn fstatat(fd: c_int, noalias path: [*:0]const u8, noalias buf: *struct_stat, flag: c_int) c_int; |
| 1494 | |
| 1495 | /// int fsync(int fildes); |
| 1496 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/fsync.html |
| 1497 | pub extern fn fsync(fd: c_int) c_int; |
| 1498 | |
| 1499 | /// int futimens(int fd, const struct timespec times[2]); |
| 1500 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/futimens.html |
| 1501 | pub extern fn futimens(fd: c_int, times: *const [2]struct_timespec) c_int; |
| 1502 | |
| 1503 | /// int getaddrinfo(const char *restrict nodename, const char *restrict servname, const struct addrinfo *restrict hints, struct addrinfo **restrict res); |
| 1504 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getaddrinfo.html |
| 1505 | pub extern fn getaddrinfo(noalias nodename: ?[*:0]const u8, noalias servname: ?[*:0]const u8, noalias req: ?*const struct_addrinfo, noalias pai: **const struct_addrinfo) c_int; |
| 1506 | |
| 1507 | /// int getchar(void); |
| 1508 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getchar.html |
| 1509 | pub extern fn getchar() c_int; |
| 1510 | |
| 1511 | /// int getchar_unlocked(void); |
| 1512 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getchar_unlocked.html |
| 1513 | pub extern fn getchar_unlocked() c_int; |
| 1514 | |
| 1515 | /// char *getcwd(char *buf, size_t size); |
| 1516 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getcwd.html |
| 1517 | pub extern fn getcwd(buf: [*]u8, size: usize) ?[*:0]u8; |
| 1518 | |
| 1519 | /// gid_t getegid(void); |
| 1520 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getegid.html |
| 1521 | pub extern fn getegid() gid_t; |
| 1522 | |
| 1523 | /// char *getenv(const char *name); |
| 1524 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getenv.html |
| 1525 | pub extern fn getenv(name: [*:0]const u8) ?[*:0]u8; |
| 1526 | |
| 1527 | /// uid_t geteuid(void); |
| 1528 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/geteuid.html |
| 1529 | pub extern fn geteuid() uid_t; |
| 1530 | |
| 1531 | /// gid_t getgid(void); |
| 1532 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getgid.html |
| 1533 | pub extern fn getgid() gid_t; |
| 1534 | |
| 1535 | /// struct group *getgrent(void); |
| 1536 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getgrent.html |
| 1537 | pub extern fn getgrent() ?*struct_group; |
| 1538 | |
| 1539 | /// struct group *getgrgid(gid_t gid); |
| 1540 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getgrgid.html |
| 1541 | pub extern fn getgrgid(gid: gid_t) ?*struct_group; |
| 1542 | |
| 1543 | /// struct group *getgrnam(const char *name); |
| 1544 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getgrnam.html |
| 1545 | pub extern fn getgrnam(name: [*:0]const u8) ?*struct_group; |
| 1546 | |
| 1547 | /// struct hostent *gethostent(void); |
| 1548 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/gethostent.html |
| 1549 | pub extern fn gethostent() ?*struct_hostent; |
| 1550 | |
| 1551 | /// long gethostid(void); |
| 1552 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/gethostid.html |
| 1553 | pub extern fn gethostid() c_long; |
| 1554 | |
| 1555 | /// int gethostname(char *name, size_t namelen); |
| 1556 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/gethostname.html |
| 1557 | pub extern fn gethostname(name: [*:0]u8, len: usize) c_int; |
| 1558 | |
| 1559 | /// struct netent *getnetbyaddr(uint32_t net, int type); |
| 1560 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getnetbyaddr.html |
| 1561 | pub extern fn getnetbyaddr(net: u32, type: c_int) ?*struct_netent; |
| 1562 | |
| 1563 | /// struct netent *getnetbyname(const char *name); |
| 1564 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getnetbyname.html |
| 1565 | pub extern fn getnetbyname(name: [*:0]const u8) ?*struct_netent; |
| 1566 | |
| 1567 | /// struct netent *getnetent(void); |
| 1568 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getnetent.html |
| 1569 | pub extern fn getnetent() ?*struct_netent; |
| 1570 | |
| 1571 | /// pid_t getpgid(pid_t pid); |
| 1572 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getpgid.html |
| 1573 | pub extern fn getpgid(pid: pid_t) pid_t; |
| 1574 | |
| 1575 | /// pid_t getpgrp(void); |
| 1576 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getpgrp.html |
| 1577 | pub extern fn getpgrp() pid_t; |
| 1578 | |
| 1579 | /// pid_t getpid(void); |
| 1580 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getpid.html |
| 1581 | pub extern fn getpid() pid_t; |
| 1582 | |
| 1583 | /// pid_t getppid(void); |
| 1584 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getppid.html |
| 1585 | pub extern fn getppid() pid_t; |
| 1586 | |
| 1587 | /// struct protoent *getprotobyname(const char *name); |
| 1588 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getprotobyname.html |
| 1589 | pub extern fn getprotobyname(name: [*:0]const u8) ?*struct_protoent; |
| 1590 | |
| 1591 | /// struct protoent *getprotobynumber(int proto); |
| 1592 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getprotobynumber.html |
| 1593 | pub extern fn getprotobynumber(proto: c_int) ?*struct_protoent; |
| 1594 | |
| 1595 | /// struct protoent *getprotoent(void); |
| 1596 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getprotoent.html |
| 1597 | pub extern fn getprotoent() ?*struct_protoent; |
| 1598 | |
| 1599 | /// struct passwd *getpwent(void); |
| 1600 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getpwent.html |
| 1601 | pub extern fn getpwent() ?*struct_passwd; |
| 1602 | |
| 1603 | /// struct passwd *getpwnam(const char *name); |
| 1604 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getpwnam.html |
| 1605 | pub extern fn getpwnam(name: [*:0]const u8) ?*struct_passwd; |
| 1606 | |
| 1607 | /// struct passwd *getpwuid(uid_t uid); |
| 1608 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getpwuid.html |
| 1609 | pub extern fn getpwuid(uid: uid_t) ?*struct_passwd; |
| 1610 | |
| 1611 | /// char *gets(char *s); |
| 1612 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/gets.html |
| 1613 | pub extern fn gets(s: [*]u8) [*:0]u8; |
| 1614 | |
| 1615 | /// struct servent *getservent(void); |
| 1616 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getservent.html |
| 1617 | pub extern fn getservent() ?*struct_servent; |
| 1618 | |
| 1619 | /// pid_t getsid(pid_t pid); |
| 1620 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getsid.html |
| 1621 | pub extern fn getsid(pid: pid_t) pid_t; |
| 1622 | |
| 1623 | /// int getsockname(int socket, struct sockaddr *restrict address, socklen_t *restrict address_len); |
| 1624 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getsockname.html |
| 1625 | pub extern fn getsockname(fd: c_int, noalias addr: *struct_sockaddr, noalias len: *socklen_t) c_int; |
| 1626 | |
| 1627 | /// uid_t getuid(void); |
| 1628 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getuid.html |
| 1629 | pub extern fn getuid() uid_t; |
| 1630 | |
| 1631 | /// struct utmpx *getutxent(void); |
| 1632 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getutxent.html |
| 1633 | pub extern fn getutxent() ?*struct_utmpx; |
| 1634 | |
| 1635 | /// wint_t getwchar(void); |
| 1636 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/getwchar.html |
| 1637 | pub extern fn getwchar() wint_t; |
| 1638 | |
| 1639 | /// int grantpt(int fildes); |
| 1640 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/grantpt.html |
| 1641 | pub extern fn grantpt(fd: c_int) c_int; |
| 1642 | |
| 1643 | /// void hdestroy(void); |
| 1644 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/hdestroy.html |
| 1645 | pub extern fn hdestroy() void; |
| 1646 | |
| 1647 | /// uint32_t htonl(uint32_t hostlong); |
| 1648 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/htonl.html |
| 1649 | pub extern fn htonl(hostlong: u32) u32; |
| 1650 | |
| 1651 | /// uint16_t htons(uint16_t hostshort); |
| 1652 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/htons.html |
| 1653 | pub extern fn htons(hostshort: u16) u16; |
| 1654 | |
| 1655 | /// double hypot(double x, double y); |
| 1656 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/hypot.html |
| 1657 | pub extern fn hypot(x: f64, y: f64) f64; |
| 1658 | |
| 1659 | /// float hypotf(float x, float y); |
| 1660 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/hypotf.html |
| 1661 | pub extern fn hypotf(x: f32, y: f32) f32; |
| 1662 | |
| 1663 | /// long double hypotl(long double x, long double y); |
| 1664 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/hypotl.html |
| 1665 | pub extern fn hypotl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 1666 | |
| 1667 | /// void if_freenameindex(struct if_nameindex *ptr); |
| 1668 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/if_freenameindex.html |
| 1669 | pub extern fn if_freenameindex(ptr: *struct_if_nameindex) void; |
| 1670 | |
| 1671 | /// struct if_nameindex *if_nameindex(void); |
| 1672 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/if_nameindex.html |
| 1673 | pub extern fn if_nameindex() ?*struct_if_nameindex; |
| 1674 | |
| 1675 | /// unsigned if_nametoindex(const char *ifname); |
| 1676 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/if_nametoindex.html |
| 1677 | pub extern fn if_nametoindex(ifname: [*:0]const u8) c_uint; |
| 1678 | |
| 1679 | /// int ilogb(double x); |
| 1680 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ilogb.html |
| 1681 | pub extern fn ilogb(x: f64) c_int; |
| 1682 | |
| 1683 | /// int ilogbf(float x); |
| 1684 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ilogbf.html |
| 1685 | pub extern fn ilogbf(x: f32) c_int; |
| 1686 | |
| 1687 | /// int ilogbl(long double x); |
| 1688 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ilogbl.html |
| 1689 | pub extern fn ilogbl(x: c_longdouble) c_int; |
| 1690 | |
| 1691 | /// intmax_t imaxabs(intmax_t j); |
| 1692 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/imaxabs.html |
| 1693 | pub extern fn imaxabs(j: intmax_t) intmax_t; |
| 1694 | |
| 1695 | /// void insque(void *element, void *pred); |
| 1696 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/insque.html |
| 1697 | pub extern fn insque(elem: *anyopaque, prev: ?*anyopaque) void; |
| 1698 | |
| 1699 | /// int isalnum(int c); |
| 1700 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isalnum.html |
| 1701 | pub extern fn isalnum(c: c_int) c_int; |
| 1702 | |
| 1703 | /// int isalnum_l(int c, locale_t locale); |
| 1704 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isalnum_l.html |
| 1705 | pub extern fn isalnum_l(c: c_int, locale: locale_t) c_int; |
| 1706 | |
| 1707 | /// int isalpha(int c); |
| 1708 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isalpha.html |
| 1709 | pub extern fn isalpha(c: c_int) c_int; |
| 1710 | |
| 1711 | /// int isalpha_l(int c, locale_t locale); |
| 1712 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isalpha_l.html |
| 1713 | pub extern fn isalpha_l(c: c_int, locale: locale_t) c_int; |
| 1714 | |
| 1715 | /// int isascii(int c); |
| 1716 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isascii.html |
| 1717 | pub extern fn isascii(c: c_int) c_int; |
| 1718 | |
| 1719 | /// int isastream(int fildes); |
| 1720 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isastream.html |
| 1721 | pub extern fn isastream(fd: c_int) c_int; |
| 1722 | |
| 1723 | /// int isatty(int fildes); |
| 1724 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isatty.html |
| 1725 | pub extern fn isatty(fd: c_int) c_int; |
| 1726 | |
| 1727 | /// int isblank(int c); |
| 1728 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isblank.html |
| 1729 | pub extern fn isblank(c: c_int) c_int; |
| 1730 | |
| 1731 | /// int isblank_l(int c, locale_t locale); |
| 1732 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isblank_l.html |
| 1733 | pub extern fn isblank_l(c: c_int, locale: locale_t) c_int; |
| 1734 | |
| 1735 | /// int iscntrl(int c); |
| 1736 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iscntrl.html |
| 1737 | pub extern fn iscntrl(c: c_int) c_int; |
| 1738 | |
| 1739 | /// int iscntrl_l(int c, locale_t locale); |
| 1740 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iscntrl_l.html |
| 1741 | pub extern fn iscntrl_l(c: c_int, locale: locale_t) c_int; |
| 1742 | |
| 1743 | /// int isdigit(int c); |
| 1744 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isdigit.html |
| 1745 | pub extern fn isdigit(c: c_int) c_int; |
| 1746 | |
| 1747 | /// int isdigit_l(int c, locale_t locale); |
| 1748 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isdigit_l.html |
| 1749 | pub extern fn isdigit_l(c: c_int, locale: locale_t) c_int; |
| 1750 | |
| 1751 | /// int isgraph(int c); |
| 1752 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isgraph.html |
| 1753 | pub extern fn isgraph(c: c_int) c_int; |
| 1754 | |
| 1755 | /// int isgraph_l(int c, locale_t locale); |
| 1756 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isgraph_l.html |
| 1757 | pub extern fn isgraph_l(c: c_int, locale: locale_t) c_int; |
| 1758 | |
| 1759 | /// int islower(int c); |
| 1760 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/islower.html |
| 1761 | pub extern fn islower(c: c_int) c_int; |
| 1762 | |
| 1763 | /// int islower_l(int c, locale_t locale); |
| 1764 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/islower_l.html |
| 1765 | pub extern fn islower_l(c: c_int, locale: locale_t) c_int; |
| 1766 | |
| 1767 | /// int isprint(int c); |
| 1768 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isprint.html |
| 1769 | pub extern fn isprint(c: c_int) c_int; |
| 1770 | |
| 1771 | /// int isprint_l(int c, locale_t locale); |
| 1772 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isprint_l.html |
| 1773 | pub extern fn isprint_l(c: c_int, locale: locale_t) c_int; |
| 1774 | |
| 1775 | /// int ispunct(int c); |
| 1776 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ispunct.html |
| 1777 | pub extern fn ispunct(c: c_int) c_int; |
| 1778 | |
| 1779 | /// int ispunct_l(int c, locale_t locale); |
| 1780 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ispunct_l.html |
| 1781 | pub extern fn ispunct_l(c: c_int, locale: locale_t) c_int; |
| 1782 | |
| 1783 | /// int isspace(int c); |
| 1784 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isspace.html |
| 1785 | pub extern fn isspace(c: c_int) c_int; |
| 1786 | |
| 1787 | /// int isspace_l(int c, locale_t locale); |
| 1788 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isspace_l.html |
| 1789 | pub extern fn isspace_l(c: c_int, locale: locale_t) c_int; |
| 1790 | |
| 1791 | /// int isupper(int c); |
| 1792 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isupper.html |
| 1793 | pub extern fn isupper(c: c_int) c_int; |
| 1794 | |
| 1795 | /// int isupper_l(int c, locale_t locale); |
| 1796 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isupper_l.html |
| 1797 | pub extern fn isupper_l(c: c_int, locale: locale_t) c_int; |
| 1798 | |
| 1799 | /// int iswalnum(wint_t wc); |
| 1800 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswalnum.html |
| 1801 | pub extern fn iswalnum(wc: wint_t) c_int; |
| 1802 | |
| 1803 | /// int iswalnum_l(wint_t wc, locale_t locale); |
| 1804 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswalnum_l.html |
| 1805 | pub extern fn iswalnum_l(wc: wint_t, locale: locale_t) c_int; |
| 1806 | |
| 1807 | /// int iswalpha(wint_t wc); |
| 1808 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswalpha.html |
| 1809 | pub extern fn iswalpha(wc: wint_t) c_int; |
| 1810 | |
| 1811 | /// int iswalpha_l(wint_t wc, locale_t locale); |
| 1812 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswalpha_l.html |
| 1813 | pub extern fn iswalpha_l(wc: wint_t, locale: locale_t) c_int; |
| 1814 | |
| 1815 | /// int iswblank(wint_t wc); |
| 1816 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswblank.html |
| 1817 | pub extern fn iswblank(wc: wint_t) c_int; |
| 1818 | |
| 1819 | /// int iswblank_l(wint_t wc, locale_t locale); |
| 1820 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswblank_l.html |
| 1821 | pub extern fn iswblank_l(wc: wint_t, locale: locale_t) c_int; |
| 1822 | |
| 1823 | /// int iswcntrl(wint_t wc); |
| 1824 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswcntrl.html |
| 1825 | pub extern fn iswcntrl(wc: wint_t) c_int; |
| 1826 | |
| 1827 | /// int iswcntrl_l(wint_t wc, locale_t locale); |
| 1828 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswcntrl_l.html |
| 1829 | pub extern fn iswcntrl_l(wc: wint_t, locale: locale_t) c_int; |
| 1830 | |
| 1831 | /// int iswdigit(wint_t wc); |
| 1832 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswdigit.html |
| 1833 | pub extern fn iswdigit(wc: wint_t) c_int; |
| 1834 | |
| 1835 | /// int iswdigit_l(wint_t wc, locale_t locale); |
| 1836 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswdigit_l.html |
| 1837 | pub extern fn iswdigit_l(wc: wint_t, locale: locale_t) c_int; |
| 1838 | |
| 1839 | /// int iswgraph(wint_t wc); |
| 1840 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswgraph.html |
| 1841 | pub extern fn iswgraph(wc: wint_t) c_int; |
| 1842 | |
| 1843 | /// int iswgraph_l(wint_t wc, locale_t locale); |
| 1844 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswgraph_l.html |
| 1845 | pub extern fn iswgraph_l(wc: wint_t, locale: locale_t) c_int; |
| 1846 | |
| 1847 | /// int iswlower(wint_t wc); |
| 1848 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswlower.html |
| 1849 | pub extern fn iswlower(wc: wint_t) c_int; |
| 1850 | |
| 1851 | /// int iswlower_l(wint_t wc, locale_t locale); |
| 1852 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswlower_l.html |
| 1853 | pub extern fn iswlower_l(wc: wint_t, locale: locale_t) c_int; |
| 1854 | |
| 1855 | /// int iswprint(wint_t wc); |
| 1856 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswprint.html |
| 1857 | pub extern fn iswprint(wc: wint_t) c_int; |
| 1858 | |
| 1859 | /// int iswprint_l(wint_t wc, locale_t locale); |
| 1860 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswprint_l.html |
| 1861 | pub extern fn iswprint_l(wc: wint_t, locale: locale_t) c_int; |
| 1862 | |
| 1863 | /// int iswpunct(wint_t wc); |
| 1864 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswpunct.html |
| 1865 | pub extern fn iswpunct(wc: wint_t) c_int; |
| 1866 | |
| 1867 | /// int iswpunct_l(wint_t wc, locale_t locale); |
| 1868 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswpunct_l.html |
| 1869 | pub extern fn iswpunct_l(wc: wint_t, locale: locale_t) c_int; |
| 1870 | |
| 1871 | /// int iswspace(wint_t wc); |
| 1872 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswspace.html |
| 1873 | pub extern fn iswspace(wc: wint_t) c_int; |
| 1874 | |
| 1875 | /// int iswspace_l(wint_t wc, locale_t locale); |
| 1876 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswspace_l.html |
| 1877 | pub extern fn iswspace_l(wc: wint_t, locale: locale_t) c_int; |
| 1878 | |
| 1879 | /// int iswupper(wint_t wc); |
| 1880 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswupper.html |
| 1881 | pub extern fn iswupper(wc: wint_t) c_int; |
| 1882 | |
| 1883 | /// int iswupper_l(wint_t wc, locale_t locale); |
| 1884 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswupper_l.html |
| 1885 | pub extern fn iswupper_l(wc: wint_t, locale: locale_t) c_int; |
| 1886 | |
| 1887 | /// int iswxdigit(wint_t wc); |
| 1888 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswxdigit.html |
| 1889 | pub extern fn iswxdigit(wc: wint_t) c_int; |
| 1890 | |
| 1891 | /// int iswxdigit_l(wint_t wc, locale_t locale); |
| 1892 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/iswxdigit_l.html |
| 1893 | pub extern fn iswxdigit_l(wc: wint_t, locale: locale_t) c_int; |
| 1894 | |
| 1895 | /// int isxdigit(int c); |
| 1896 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isxdigit.html |
| 1897 | pub extern fn isxdigit(c: c_int) c_int; |
| 1898 | |
| 1899 | /// int isxdigit_l(int c, locale_t locale); |
| 1900 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/isxdigit_l.html |
| 1901 | pub extern fn isxdigit_l(c: c_int, locale: locale_t) c_int; |
| 1902 | |
| 1903 | /// double j0(double x); |
| 1904 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/j0.html |
| 1905 | pub extern fn j0(x: f64) f64; |
| 1906 | |
| 1907 | /// double j1(double x); |
| 1908 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/j1.html |
| 1909 | pub extern fn j1(x: f64) f64; |
| 1910 | |
| 1911 | /// double jn(int n, double x); |
| 1912 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/jn.html |
| 1913 | pub extern fn jn(n: c_int, x: f64) f64; |
| 1914 | |
| 1915 | /// int kill(pid_t pid, int sig); |
| 1916 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/kill.html |
| 1917 | pub extern fn kill(pid: pid_t, sig: c_int) c_int; |
| 1918 | |
| 1919 | /// long labs(long i); |
| 1920 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/labs.html |
| 1921 | pub extern fn labs(i: c_long) c_long; |
| 1922 | |
| 1923 | /// double ldexp(double x, int exp); |
| 1924 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ldexp.html |
| 1925 | pub extern fn ldexp(x: f64, exp: c_int) f64; |
| 1926 | |
| 1927 | /// float ldexpf(float x, int exp); |
| 1928 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ldexpf.html |
| 1929 | pub extern fn ldexpf(x: f32, exp: c_int) f32; |
| 1930 | |
| 1931 | /// double lgamma(double x); |
| 1932 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lgamma.html |
| 1933 | pub extern fn lgamma(x: f64) f64; |
| 1934 | |
| 1935 | /// float lgammaf(float x); |
| 1936 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lgammaf.html |
| 1937 | pub extern fn lgammaf(x: f32) f32; |
| 1938 | |
| 1939 | /// long double lgammal(long double x); |
| 1940 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lgammal.html |
| 1941 | pub extern fn lgammal(x: c_longdouble) c_longdouble; |
| 1942 | |
| 1943 | /// int listen(int socket, int backlog); |
| 1944 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/listen.html |
| 1945 | pub extern fn listen(socket: c_int, backlog: c_int) c_int; |
| 1946 | |
| 1947 | /// long long llabs(long long i); |
| 1948 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/llabs.html |
| 1949 | pub extern fn llabs(x: c_longlong) c_longlong; |
| 1950 | |
| 1951 | /// long long llrint(double x); |
| 1952 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/llrint.html |
| 1953 | pub extern fn llrint(x: f64) c_longlong; |
| 1954 | |
| 1955 | /// long long llrintf(float x); |
| 1956 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/llrintf.html |
| 1957 | pub extern fn llrintf(x: f32) c_longlong; |
| 1958 | |
| 1959 | /// long long llrintl(long double x); |
| 1960 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/llrintl.html |
| 1961 | pub extern fn llrintl(x: c_longdouble) c_longlong; |
| 1962 | |
| 1963 | /// long long llround(double x); |
| 1964 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/llround.html |
| 1965 | pub extern fn llround(x: f64) c_longlong; |
| 1966 | |
| 1967 | /// long long llroundf(float x); |
| 1968 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/llroundf.html |
| 1969 | pub extern fn llroundf(x: f32) c_longlong; |
| 1970 | |
| 1971 | /// long long llroundl(long double x); |
| 1972 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/llroundl.html |
| 1973 | pub extern fn llroundl(x: c_longdouble) c_longlong; |
| 1974 | |
| 1975 | /// struct lconv *localeconv(void); |
| 1976 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/localeconv.html |
| 1977 | pub extern fn localeconv() *struct_lconv; |
| 1978 | |
| 1979 | /// double log(double x); |
| 1980 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log.html |
| 1981 | pub extern fn log(x: f64) f64; |
| 1982 | |
| 1983 | /// double log1p(double x); |
| 1984 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log1p.html |
| 1985 | pub extern fn log1p(x: f64) f64; |
| 1986 | |
| 1987 | /// float log1pf(float x); |
| 1988 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log1pf.html |
| 1989 | pub extern fn log1pf(x: f32) f32; |
| 1990 | |
| 1991 | /// long double log1pl(long double x); |
| 1992 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log1pl.html |
| 1993 | pub extern fn log1pl(x: c_longdouble) c_longdouble; |
| 1994 | |
| 1995 | /// double log2(double x); |
| 1996 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log2.html |
| 1997 | pub extern fn log2(x: f64) f64; |
| 1998 | |
| 1999 | /// float log2f(float x); |
| 2000 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log2f.html |
| 2001 | pub extern fn log2f(x: f32) f32; |
| 2002 | |
| 2003 | /// long double log2l(long double x); |
| 2004 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log2l.html |
| 2005 | pub extern fn log2l(x: c_longdouble) c_longdouble; |
| 2006 | |
| 2007 | /// double log10(double x); |
| 2008 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log10.html |
| 2009 | pub extern fn log10(x: f64) f64; |
| 2010 | |
| 2011 | /// float log10f(float x); |
| 2012 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log10f.html |
| 2013 | pub extern fn log10f(x: f32) f32; |
| 2014 | |
| 2015 | /// long double log10l(long double x); |
| 2016 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/log10l.html |
| 2017 | pub extern fn log10l(x: c_longdouble) c_longdouble; |
| 2018 | |
| 2019 | /// double logb(double x); |
| 2020 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/logb.html |
| 2021 | pub extern fn logb(x: f64) f64; |
| 2022 | |
| 2023 | /// float logbf(float x); |
| 2024 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/logbf.html |
| 2025 | pub extern fn logbf(x: f32) f32; |
| 2026 | |
| 2027 | /// long double logbl(long double x); |
| 2028 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/logbl.html |
| 2029 | pub extern fn logbl(x: c_longdouble) c_longdouble; |
| 2030 | |
| 2031 | /// float logf(float x); |
| 2032 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/logf.html |
| 2033 | pub extern fn logf(x: f32) f32; |
| 2034 | |
| 2035 | /// long double logl(long double x); |
| 2036 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/logl.html |
| 2037 | pub extern fn logl(x: c_longdouble) c_longdouble; |
| 2038 | |
| 2039 | /// long lrand48(void); |
| 2040 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lrand48.html |
| 2041 | pub extern fn lrand48() c_long; |
| 2042 | |
| 2043 | /// long lrint(double x); |
| 2044 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lrint.html |
| 2045 | pub extern fn lrint(x: f64) c_long; |
| 2046 | |
| 2047 | /// long lrintf(float x); |
| 2048 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lrintf.html |
| 2049 | pub extern fn lrintf(x: f32) c_long; |
| 2050 | |
| 2051 | /// long lrintl(long double x); |
| 2052 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lrintl.html |
| 2053 | pub extern fn lrintl(x: c_longdouble) c_long; |
| 2054 | |
| 2055 | /// long lround(double x); |
| 2056 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lround.html |
| 2057 | pub extern fn lround(x: f64) c_long; |
| 2058 | |
| 2059 | /// long lroundf(float x); |
| 2060 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lroundf.html |
| 2061 | pub extern fn lroundf(x: f32) c_long; |
| 2062 | |
| 2063 | /// long lroundl(long double x); |
| 2064 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lroundl.html |
| 2065 | pub extern fn lroundl(x: c_longdouble) c_long; |
| 2066 | |
| 2067 | /// off_t lseek(int fildes, off_t offset, int whence); |
| 2068 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/lseek.html |
| 2069 | pub extern fn lseek(fd: c_int, offset: off_t, whence: c_int) off_t; |
| 2070 | |
| 2071 | /// void *malloc(size_t size); |
| 2072 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/malloc.html |
| 2073 | pub extern fn malloc(size: usize) ?*anyopaque; |
| 2074 | |
| 2075 | /// int mkdir(const char *path, mode_t mode); |
| 2076 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkdir.html |
| 2077 | pub extern fn mkdir(path: [*:0]const u8, __mode: mode_t) c_int; |
| 2078 | |
| 2079 | /// int mkdirat(int fd, const char *path, mode_t mode); |
| 2080 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkdirat.html |
| 2081 | pub extern fn mkdirat(fd: c_int, path: [*:0]const u8, mode: mode_t) c_int; |
| 2082 | |
| 2083 | /// char *mkdtemp(char *template); |
| 2084 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkdtemp.html |
| 2085 | pub extern fn mkdtemp(template: [*:0]u8) ?[*:0]u8; |
| 2086 | |
| 2087 | /// int mkfifo(const char *path, mode_t mode); |
| 2088 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkfifo.html |
| 2089 | pub extern fn mkfifo(path: [*:0]const u8, mode: mode_t) c_int; |
| 2090 | |
| 2091 | /// int mkfifoat(int fd, const char *path, mode_t mode); |
| 2092 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkfifoat.html |
| 2093 | pub extern fn mkfifoat(fd: c_int, path: [*:0]const u8, mode: mode_t) c_int; |
| 2094 | |
| 2095 | /// int mkstemp(char *template); |
| 2096 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mkstemp.html |
| 2097 | pub extern fn mkstemp(template: [*:0]u8) c_int; |
| 2098 | |
| 2099 | /// int mlockall(int flags); |
| 2100 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mlockall.html |
| 2101 | pub extern fn mlockall(flags: c_int) c_int; |
| 2102 | |
| 2103 | /// void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); |
| 2104 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mmap.html |
| 2105 | pub extern fn mmap(addr: ?*anyopaque, len: usize, prot: c_int, flags: c_int, fd: c_int, offset: off_t) *allowzero anyopaque; |
| 2106 | |
| 2107 | /// int mq_unlink(const char *name); |
| 2108 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mq_unlink.html |
| 2109 | pub extern fn mq_unlink(name: [*:0]const u8) c_int; |
| 2110 | |
| 2111 | /// long mrand48(void); |
| 2112 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/mrand48.html |
| 2113 | pub extern fn mrand48() c_long; |
| 2114 | |
| 2115 | /// int munlockall(void); |
| 2116 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/munlockall.html |
| 2117 | pub extern fn munlockall() void; |
| 2118 | |
| 2119 | /// int munmap(void *addr, size_t len); |
| 2120 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/munmap.html |
| 2121 | pub extern fn munmap(addr: *const anyopaque, len: usize) c_int; |
| 2122 | |
| 2123 | /// double nearbyint(double x); |
| 2124 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nearbyint.html |
| 2125 | pub extern fn nearbyint(x: f64) f64; |
| 2126 | |
| 2127 | /// float nearbyintf(float x); |
| 2128 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nearbyintf.html |
| 2129 | pub extern fn nearbyintf(x: f32) f32; |
| 2130 | |
| 2131 | /// long double nearbyintl(long double x); |
| 2132 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nearbyintl.html |
| 2133 | pub extern fn nearbyintl(x: c_longdouble) c_longdouble; |
| 2134 | |
| 2135 | /// double nextafter(double x, double y); |
| 2136 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nextafter.html |
| 2137 | pub extern fn nextafter(x: f64, y: f64) f64; |
| 2138 | |
| 2139 | /// float nextafterf(float x, float y); |
| 2140 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nextafterf.html |
| 2141 | pub extern fn nextafterf(x: f32, y: f32) f32; |
| 2142 | |
| 2143 | /// long double nextafterl(long double x, long double y); |
| 2144 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nextafterl.html |
| 2145 | pub extern fn nextafterl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 2146 | |
| 2147 | /// double nexttoward(double x, long double y); |
| 2148 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nexttoward.html |
| 2149 | pub extern fn nexttoward(x: f64, y: c_longdouble) f64; |
| 2150 | |
| 2151 | /// float nexttowardf(float x, long double y); |
| 2152 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nexttowardf.html |
| 2153 | pub extern fn nexttowardf(x: f32, y: c_longdouble) f32; |
| 2154 | |
| 2155 | /// long double nexttowardl(long double x, long double y); |
| 2156 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nexttowardl.html |
| 2157 | pub extern fn nexttowardl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 2158 | |
| 2159 | /// int nice(int incr); |
| 2160 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/nice.html |
| 2161 | pub extern fn nice(incr: c_int) c_int; |
| 2162 | |
| 2163 | /// uint32_t ntohl(uint32_t netlong); |
| 2164 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ntohl.html |
| 2165 | pub extern fn ntohl(netlong: u32) u32; |
| 2166 | |
| 2167 | /// uint16_t ntohs(uint16_t netshort); |
| 2168 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ntohs.html |
| 2169 | pub extern fn ntohs(netshort: u16) u16; |
| 2170 | |
| 2171 | /// int openat(int fd, const char *path, int oflag, ...); |
| 2172 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/openat.html |
| 2173 | pub extern fn openat(fd: c_int, file: [*:0]const u8, oflag: c_int, ...) c_int; |
| 2174 | |
| 2175 | /// int pause(void); |
| 2176 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pause.html |
| 2177 | pub extern fn pause() c_int; |
| 2178 | |
| 2179 | /// int pipe2(int fildes[2], int flag); |
| 2180 | /// https://pubs.opengroup.org/onlinepubs/9799919799/functions/pipe.html |
| 2181 | pub extern fn pipe2(pipefd: *[2]c_int, flag: c_int) c_int; |
| 2182 | |
| 2183 | /// int poll(struct pollfd fds[], nfds_t nfds, int timeout); |
| 2184 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/poll.html |
| 2185 | pub extern fn poll(fds: [*]struct_pollfd, nfds: nfds_t, timeout: c_int) c_int; |
| 2186 | |
| 2187 | /// double pow(double x, double y); |
| 2188 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pow.html |
| 2189 | pub extern fn pow(x: f64, y: f64) f64; |
| 2190 | |
| 2191 | /// float powf(float x, float y); |
| 2192 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/powf.html |
| 2193 | pub extern fn powf(x: f32, y: f32) f32; |
| 2194 | |
| 2195 | /// long double powl(long double x, long double y); |
| 2196 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/powl.html |
| 2197 | pub extern fn powl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 2198 | |
| 2199 | /// int pthread_attr_destroy(pthread_attr_t *attr); |
| 2200 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_attr_destroy.html |
| 2201 | pub extern fn pthread_attr_destroy(attr: *pthread_attr_t) c_int; |
| 2202 | |
| 2203 | /// int pthread_attr_init(pthread_attr_t *attr); |
| 2204 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_attr_init.html |
| 2205 | pub extern fn pthread_attr_init(attr: *pthread_attr_t) c_int; |
| 2206 | |
| 2207 | /// int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize); |
| 2208 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_attr_setguardsize.html |
| 2209 | pub extern fn pthread_attr_setguardsize(attr: *pthread_attr_t, guardsize: usize) c_int; |
| 2210 | |
| 2211 | /// int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); |
| 2212 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_attr_setstacksize.html |
| 2213 | pub extern fn pthread_attr_setstacksize(attr: *pthread_attr_t, stacksize: usize) c_int; |
| 2214 | |
| 2215 | /// int pthread_cancel(pthread_t thread); |
| 2216 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_cancel.html |
| 2217 | pub extern fn pthread_cancel(thread: pthread_t) c_int; |
| 2218 | |
| 2219 | /// int pthread_cond_broadcast(pthread_cond_t *cond); |
| 2220 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_cond_broadcast.html |
| 2221 | pub extern fn pthread_cond_broadcast(cond: *pthread_cond_t) c_int; |
| 2222 | |
| 2223 | /// int pthread_cond_destroy(pthread_cond_t *cond); |
| 2224 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_cond_destroy.html |
| 2225 | pub extern fn pthread_cond_destroy(cond: *pthread_cond_t) c_int; |
| 2226 | |
| 2227 | /// int pthread_cond_init(pthread_cond_t *restrict cond, const pthread_condattr_t *restrict attr); |
| 2228 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_cond_init.html |
| 2229 | pub extern fn pthread_cond_init(noalias cond: *pthread_cond_t, noalias attr: ?*const pthread_condattr_t) c_int; |
| 2230 | |
| 2231 | /// int pthread_cond_signal(pthread_cond_t *cond); |
| 2232 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_cond_signal.html |
| 2233 | pub extern fn pthread_cond_signal(cond: *pthread_cond_t) c_int; |
| 2234 | |
| 2235 | /// int pthread_cond_timedwait(pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex, const struct timespec *restrict abstime); |
| 2236 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_cond_timedwait.html |
| 2237 | pub extern fn pthread_cond_timedwait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t, noalias abstime: *const struct_timespec) c_int; |
| 2238 | |
| 2239 | /// int pthread_cond_wait(pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex); |
| 2240 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_cond_wait.html |
| 2241 | pub extern fn pthread_cond_wait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t) c_int; |
| 2242 | |
| 2243 | /// int pthread_condattr_destroy(pthread_condattr_t *attr); |
| 2244 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_destroy.html |
| 2245 | pub extern fn pthread_condattr_destroy(attr: *pthread_condattr_t) c_int; |
| 2246 | |
| 2247 | /// int pthread_condattr_init(pthread_condattr_t *attr); |
| 2248 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_condattr_init.html |
| 2249 | pub extern fn pthread_condattr_init(attr: *pthread_condattr_t) c_int; |
| 2250 | |
| 2251 | /// int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr, void *(*start_routine)(void*), void *restrict arg); |
| 2252 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_create.html |
| 2253 | pub extern fn pthread_create(noalias newthread: *pthread_t, noalias attr: *const pthread_attr_t, start_routine: *const fn (*anyopaque) callconv(.c) ?*anyopaque, noalias arg: *anyopaque) c_int; |
| 2254 | |
| 2255 | /// int pthread_detach(pthread_t thread); |
| 2256 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_detach.html |
| 2257 | pub extern fn pthread_detach(thread: pthread_t) c_int; |
| 2258 | |
| 2259 | /// int pthread_equal(pthread_t t1, pthread_t t2); |
| 2260 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_equal.html |
| 2261 | pub extern fn pthread_equal(thread1: pthread_t, thread2: pthread_t) c_int; |
| 2262 | |
| 2263 | /// int pthread_getconcurrency(void); |
| 2264 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_getconcurrency.html |
| 2265 | pub extern fn pthread_getconcurrency() c_int; |
| 2266 | |
| 2267 | /// int pthread_join(pthread_t thread, void **value_ptr); |
| 2268 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_join.html |
| 2269 | pub extern fn pthread_join(thread: pthread_t, retval: ?*?*anyopaque) c_int; |
| 2270 | |
| 2271 | /// int pthread_kill(pthread_t thread, int sig); |
| 2272 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_kill.html |
| 2273 | pub extern fn pthread_kill(thread: pthread_t, sig: c_int) c_int; |
| 2274 | |
| 2275 | /// int pthread_mutex_destroy(pthread_mutex_t *mutex); |
| 2276 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutex_destroy.html |
| 2277 | pub extern fn pthread_mutex_destroy(mutex: *pthread_mutex_t) c_int; |
| 2278 | |
| 2279 | /// int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr); |
| 2280 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutex_init.html |
| 2281 | pub extern fn pthread_mutex_init(mutex: *pthread_mutex_t, attr: ?*const pthread_mutexattr_t) c_int; |
| 2282 | |
| 2283 | /// int pthread_mutex_lock(pthread_mutex_t *mutex); |
| 2284 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutex_lock.html |
| 2285 | pub extern fn pthread_mutex_lock(mutex: *pthread_mutex_t) c_int; |
| 2286 | |
| 2287 | /// int pthread_mutex_trylock(pthread_mutex_t *mutex); |
| 2288 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutex_trylock.html |
| 2289 | pub extern fn pthread_mutex_trylock(mutex: *pthread_mutex_t) c_int; |
| 2290 | |
| 2291 | /// int pthread_mutex_unlock(pthread_mutex_t *mutex); |
| 2292 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutex_unlock.html |
| 2293 | pub extern fn pthread_mutex_unlock(mutex: *pthread_mutex_t) c_int; |
| 2294 | |
| 2295 | /// int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); |
| 2296 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutexattr_destroy.html |
| 2297 | pub extern fn pthread_mutexattr_destroy(attr: *pthread_mutexattr_t) c_int; |
| 2298 | |
| 2299 | /// int pthread_mutexattr_init(pthread_mutexattr_t *attr); |
| 2300 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_mutexattr_init.html |
| 2301 | pub extern fn pthread_mutexattr_init(attr: *pthread_mutexattr_t) c_int; |
| 2302 | |
| 2303 | /// int pthread_rwlock_destroy(pthread_rwlock_t *rwlock); |
| 2304 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_destroy.html |
| 2305 | pub extern fn pthread_rwlock_destroy(rwlock: *pthread_rwlock_t) c_int; |
| 2306 | |
| 2307 | /// int pthread_rwlock_init(pthread_rwlock_t *restrict rwlock, const pthread_rwlockattr_t *restrict attr); |
| 2308 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_init.html |
| 2309 | pub extern fn pthread_rwlock_init(noalias rwlock: *pthread_rwlock_t, noalias attr: ?*const pthread_rwlockattr_t) c_int; |
| 2310 | |
| 2311 | /// int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock); |
| 2312 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_rdlock.html |
| 2313 | pub extern fn pthread_rwlock_rdlock(rwlock: *pthread_rwlock_t) c_int; |
| 2314 | |
| 2315 | /// int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock); |
| 2316 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_tryrdlock.html |
| 2317 | pub extern fn pthread_rwlock_tryrdlock(rwlock: *pthread_rwlock_t) c_int; |
| 2318 | |
| 2319 | /// int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock); |
| 2320 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_trywrlock.html |
| 2321 | pub extern fn pthread_rwlock_trywrlock(rwlock: *pthread_rwlock_t) c_int; |
| 2322 | |
| 2323 | /// int pthread_rwlock_unlock(pthread_rwlock_t *rwlock); |
| 2324 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_unlock.html |
| 2325 | pub extern fn pthread_rwlock_unlock(rwlock: *pthread_rwlock_t) c_int; |
| 2326 | |
| 2327 | /// int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock); |
| 2328 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_rwlock_wrlock.html |
| 2329 | pub extern fn pthread_rwlock_wrlock(rwlock: *pthread_rwlock_t) c_int; |
| 2330 | |
| 2331 | /// pthread_t pthread_self(void); |
| 2332 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_self.html |
| 2333 | pub extern fn pthread_self() pthread_t; |
| 2334 | |
| 2335 | /// void pthread_testcancel(void); |
| 2336 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/pthread_testcancel.html |
| 2337 | pub extern fn pthread_testcancel() void; |
| 2338 | |
| 2339 | /// int putchar(int c); |
| 2340 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/putchar.html |
| 2341 | pub extern fn putchar(c: c_int) c_int; |
| 2342 | |
| 2343 | /// int putchar_unlocked(int c); |
| 2344 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/putchar_unlocked.html |
| 2345 | pub extern fn putchar_unlocked(c: c_int) c_int; |
| 2346 | |
| 2347 | /// wint_t putwchar(wchar_t wc); |
| 2348 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/putwchar.html |
| 2349 | pub extern fn putwchar(wc: wchar_t) wint_t; |
| 2350 | |
| 2351 | /// int raise(int sig); |
| 2352 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/raise.html |
| 2353 | pub extern fn raise(sig: c_int) c_int; |
| 2354 | |
| 2355 | /// int rand(void); |
| 2356 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/rand.html |
| 2357 | pub extern fn rand() c_int; |
| 2358 | |
| 2359 | /// long random(void); |
| 2360 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/random.html |
| 2361 | pub extern fn random() c_long; |
| 2362 | |
| 2363 | /// ssize_t read(int fildes, void *buf, size_t nbyte); |
| 2364 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/read.html |
| 2365 | pub extern fn read(fd: c_int, buf: [*]u8, count: usize) isize; |
| 2366 | |
| 2367 | /// ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); |
| 2368 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/readlink.html |
| 2369 | pub extern fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, len: usize) isize; |
| 2370 | |
| 2371 | /// ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize); |
| 2372 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/readlinkat.html |
| 2373 | pub extern fn readlinkat(fd: c_int, noalias path: [*:0]const u8, noalias buf: [*]u8, len: usize) isize; |
| 2374 | |
| 2375 | /// ssize_t recv(int socket, void *buffer, size_t length, int flags); |
| 2376 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/recv.html |
| 2377 | pub extern fn recv(fd: c_int, buffer: [*]u8, length: usize, flags: c_int) isize; |
| 2378 | |
| 2379 | /// double remainder(double x, double y); |
| 2380 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/remainder.html |
| 2381 | pub extern fn remainder(x: f64, y: f64) f64; |
| 2382 | |
| 2383 | /// float remainderf(float x, float y); |
| 2384 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/remainderf.html |
| 2385 | pub extern fn remainderf(x: f32, y: f32) f32; |
| 2386 | |
| 2387 | /// long double remainderl(long double x, long double y); |
| 2388 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/remainderl.html |
| 2389 | pub extern fn remainderl(x: c_longdouble, y: c_longdouble) c_longdouble; |
| 2390 | |
| 2391 | /// int renameat(int oldfd, const char *old, int newfd, const char *new); |
| 2392 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/renameat.html |
| 2393 | pub extern fn renameat(oldfd: c_int, old: [*:0]const u8, newfd: c_int, new: [*:0]const u8) c_int; |
| 2394 | |
| 2395 | /// double rint(double x); |
| 2396 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/rint.html |
| 2397 | pub extern fn rint(x: f64) f64; |
| 2398 | |
| 2399 | /// float rintf(float x); |
| 2400 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/rintf.html |
| 2401 | pub extern fn rintf(x: f32) f32; |
| 2402 | |
| 2403 | /// long double rintl(long double x); |
| 2404 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/rintl.html |
| 2405 | pub extern fn rintl(x: c_longdouble) c_longdouble; |
| 2406 | |
| 2407 | /// int rmdir(const char *path); |
| 2408 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/rmdir.html |
| 2409 | pub extern fn rmdir(path: [*:0]const u8) c_int; |
| 2410 | |
| 2411 | /// double round(double x); |
| 2412 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/round.html |
| 2413 | pub extern fn round(x: f64) f64; |
| 2414 | |
| 2415 | /// float roundf(float x); |
| 2416 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/roundf.html |
| 2417 | pub extern fn roundf(x: f32) f32; |
| 2418 | |
| 2419 | /// long double roundl(long double x); |
| 2420 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/roundl.html |
| 2421 | pub extern fn roundl(x: c_longdouble) c_longdouble; |
| 2422 | |
| 2423 | /// double scalbln(double x, long n); |
| 2424 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/scalbln.html |
| 2425 | pub extern fn scalbln(x: f64, n: c_long) f64; |
| 2426 | |
| 2427 | /// float scalblnf(float x, long n); |
| 2428 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/scalblnf.html |
| 2429 | pub extern fn scalblnf(x: f32, n: c_long) f32; |
| 2430 | |
| 2431 | /// long double scalblnl(long double x, long n); |
| 2432 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/scalblnl.html |
| 2433 | pub extern fn scalblnl(x: c_longdouble, n: c_long) c_longdouble; |
| 2434 | |
| 2435 | /// double scalbn(double x, int n); |
| 2436 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/scalbn.html |
| 2437 | pub extern fn scalbn(x: f64, n: c_int) f64; |
| 2438 | |
| 2439 | /// float scalbnf(float x, int n); |
| 2440 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/scalbnf.html |
| 2441 | pub extern fn scalbnf(x: f32, n: c_int) f32; |
| 2442 | |
| 2443 | /// long double scalbnl(long double x, int n); |
| 2444 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/scalbnl.html |
| 2445 | pub extern fn scalbnl(x: c_longdouble, n: c_int) c_longdouble; |
| 2446 | |
| 2447 | /// int sched_get_priority_max(int policy); |
| 2448 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sched_get_priority_max.html |
| 2449 | pub extern fn sched_get_priority_max(policy: c_int) c_int; |
| 2450 | |
| 2451 | /// int sched_get_priority_min(int policy); |
| 2452 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sched_get_priority_min.html |
| 2453 | pub extern fn sched_get_priority_min(policy: c_int) c_int; |
| 2454 | |
| 2455 | /// int sched_getscheduler(pid_t pid); |
| 2456 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sched_getscheduler.html |
| 2457 | pub extern fn sched_getscheduler(pid: pid_t) c_int; |
| 2458 | |
| 2459 | /// int sched_yield(void); |
| 2460 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sched_yield.html |
| 2461 | pub extern fn sched_yield() c_int; |
| 2462 | |
| 2463 | /// int sem_unlink(const char *name); |
| 2464 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sem_unlink.html |
| 2465 | pub extern fn sem_unlink(name: [*:0]const u8) c_int; |
| 2466 | |
| 2467 | /// int semctl(int semid, int semnum, int cmd, ...); |
| 2468 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/semctl.html |
| 2469 | pub extern fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) c_int; |
| 2470 | |
| 2471 | /// ssize_t send(int socket, const void *buffer, size_t length, int flags); |
| 2472 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/send.html |
| 2473 | pub extern fn send(fd: c_int, buffer: [*]const u8, length: usize, flags: c_int) isize; |
| 2474 | |
| 2475 | /// int setegid(gid_t gid); |
| 2476 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setegid.html |
| 2477 | pub extern fn setegid(gid: gid_t) c_int; |
| 2478 | |
| 2479 | /// int seteuid(uid_t uid); |
| 2480 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/seteuid.html |
| 2481 | pub extern fn seteuid(uid: uid_t) c_int; |
| 2482 | |
| 2483 | /// int setgid(gid_t gid); |
| 2484 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setgid.html |
| 2485 | pub extern fn setgid(gid: gid_t) c_int; |
| 2486 | |
| 2487 | /// void setgrent(void); |
| 2488 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setgrent.html |
| 2489 | pub extern fn setgrent() void; |
| 2490 | |
| 2491 | /// void sethostent(int stayopen); |
| 2492 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sethostent.html |
| 2493 | pub extern fn sethostent(stayopen: c_int) void; |
| 2494 | |
| 2495 | /// int setlogmask(int maskpri); |
| 2496 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setlogmask.html |
| 2497 | pub extern fn setlogmask(maskpri: c_int) c_int; |
| 2498 | |
| 2499 | /// void setnetent(int stayopen); |
| 2500 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setnetent.html |
| 2501 | pub extern fn setnetent(stayopen: c_int) void; |
| 2502 | |
| 2503 | /// pid_t setpgrp(void); |
| 2504 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setpgrp.html |
| 2505 | pub extern fn setpgrp() pid_t; |
| 2506 | |
| 2507 | /// void setprotoent(int stayopen); |
| 2508 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setprotoent.html |
| 2509 | pub extern fn setprotoent(stayopen: c_int) void; |
| 2510 | |
| 2511 | /// void setpwent(void); |
| 2512 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setpwent.html |
| 2513 | pub extern fn setpwent() void; |
| 2514 | |
| 2515 | /// int setregid(gid_t rgid, gid_t egid); |
| 2516 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setregid.html |
| 2517 | pub extern fn setregid(rgid: gid_t, egid: gid_t) c_int; |
| 2518 | |
| 2519 | /// int setreuid(uid_t ruid, uid_t euid); |
| 2520 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setreuid.html |
| 2521 | pub extern fn setreuid(ruid: uid_t, euid: uid_t) c_int; |
| 2522 | |
| 2523 | /// void setservent(int stayopen); |
| 2524 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setservent.html |
| 2525 | pub extern fn setservent(stayopen: c_int) void; |
| 2526 | |
| 2527 | /// pid_t setsid(void); |
| 2528 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setsid.html |
| 2529 | pub extern fn setsid() pid_t; |
| 2530 | |
| 2531 | /// int setsockopt(int socket, int level, int option_name, const void *option_value, socklen_t option_len); |
| 2532 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setsockopt.html |
| 2533 | pub extern fn setsockopt(fd: c_int, level: c_int, optname: c_int, optval: *const anyopaque, optlen: socklen_t) c_int; |
| 2534 | |
| 2535 | /// int setuid(uid_t uid); |
| 2536 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setuid.html |
| 2537 | pub extern fn setuid(uid: uid_t) c_int; |
| 2538 | |
| 2539 | /// void setutxent(void); |
| 2540 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/setutxent.html |
| 2541 | pub extern fn setutxent() void; |
| 2542 | |
| 2543 | /// int shm_unlink(const char *name); |
| 2544 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/shm_unlink.html |
| 2545 | pub extern fn shm_unlink(name: [*:0]const u8) c_int; |
| 2546 | |
| 2547 | /// int shutdown(int socket, int how); |
| 2548 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/shutdown.html |
| 2549 | pub extern fn shutdown(socket: c_int, how: c_int) c_int; |
| 2550 | |
| 2551 | /// int sighold(int sig); |
| 2552 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sighold.html |
| 2553 | pub extern fn sighold(sig: c_int) c_int; |
| 2554 | |
| 2555 | /// int sigignore(int sig); |
| 2556 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sigignore.html |
| 2557 | pub extern fn sigignore(sig: c_int) c_int; |
| 2558 | |
| 2559 | /// int siginterrupt(int sig, int flag); |
| 2560 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/siginterrupt.html |
| 2561 | pub extern fn siginterrupt(sig: c_int, flag: c_int) c_int; |
| 2562 | |
| 2563 | /// int sigpause(int sig); |
| 2564 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sigpause.html |
| 2565 | pub extern fn sigpause(sig: c_int) c_int; |
| 2566 | |
| 2567 | /// int sigrelse(int sig); |
| 2568 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sigrelse.html |
| 2569 | pub extern fn sigrelse(sig: c_int) c_int; |
| 2570 | |
| 2571 | /// double sin(double x); |
| 2572 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sin.html |
| 2573 | pub extern fn sin(x: f64) f64; |
| 2574 | |
| 2575 | /// float sinf(float x); |
| 2576 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sinf.html |
| 2577 | pub extern fn sinf(x: f32) f32; |
| 2578 | |
| 2579 | /// double sinh(double x); |
| 2580 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sinh.html |
| 2581 | pub extern fn sinh(x: f64) f64; |
| 2582 | |
| 2583 | /// float sinhf(float x); |
| 2584 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sinhf.html |
| 2585 | pub extern fn sinhf(x: f32) f32; |
| 2586 | |
| 2587 | /// long double sinhl(long double x); |
| 2588 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sinhl.html |
| 2589 | pub extern fn sinhl(x: c_longdouble) c_longdouble; |
| 2590 | |
| 2591 | /// long double sinl(long double x); |
| 2592 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sinl.html |
| 2593 | pub extern fn sinl(x: c_longdouble) c_longdouble; |
| 2594 | |
| 2595 | /// unsigned sleep(unsigned seconds); |
| 2596 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sleep.html |
| 2597 | pub extern fn sleep(seconds: c_uint) c_uint; |
| 2598 | |
| 2599 | /// int sockatmark(int s); |
| 2600 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sockatmark.html |
| 2601 | pub extern fn sockatmark(s: c_int) c_int; |
| 2602 | |
| 2603 | /// int socket(int domain, int type, int protocol); |
| 2604 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/socket.html |
| 2605 | pub extern fn socket(domain: c_int, type: c_int, protocol: c_int) c_int; |
| 2606 | |
| 2607 | /// int socketpair(int domain, int type, int protocol, int socket_vector[2]); |
| 2608 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/socketpair.html |
| 2609 | pub extern fn socketpair(domain: c_int, type: c_int, protocol: c_int, fds: *[2]c_int) c_int; |
| 2610 | |
| 2611 | /// double sqrt(double x); |
| 2612 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sqrt.html |
| 2613 | pub extern fn sqrt(x: f64) f64; |
| 2614 | |
| 2615 | /// float sqrtf(float x); |
| 2616 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sqrtf.html |
| 2617 | pub extern fn sqrtf(x: f32) f32; |
| 2618 | |
| 2619 | /// long double sqrtl(long double x); |
| 2620 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sqrtl.html |
| 2621 | pub extern fn sqrtl(x: c_longdouble) c_longdouble; |
| 2622 | |
| 2623 | /// void srand(unsigned seed); |
| 2624 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/srand.html |
| 2625 | pub extern fn srand(seed: c_uint) void; |
| 2626 | |
| 2627 | /// void srand48(long seedval); |
| 2628 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/srand48.html |
| 2629 | pub extern fn srand48(seedval: c_long) void; |
| 2630 | |
| 2631 | /// void srandom(unsigned seed); |
| 2632 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/srandom.html |
| 2633 | pub extern fn srandom(seed: c_uint) void; |
| 2634 | |
| 2635 | /// size_t strlen(const char *s); |
| 2636 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/strlen.html |
| 2637 | pub extern fn strlen(s: [*:0]const u8) c_ulong; |
| 2638 | |
| 2639 | /// void sync(void); |
| 2640 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sync.html |
| 2641 | pub extern fn sync() void; |
| 2642 | |
| 2643 | /// long sysconf(int name); |
| 2644 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/sysconf.html |
| 2645 | pub extern fn sysconf(name: c_int) c_long; |
| 2646 | |
| 2647 | /// double tan(double x); |
| 2648 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tan.html |
| 2649 | pub extern fn tan(x: f64) f64; |
| 2650 | |
| 2651 | /// float tanf(float x); |
| 2652 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tanf.html |
| 2653 | pub extern fn tanf(x: f32) f32; |
| 2654 | |
| 2655 | /// double tanh(double x); |
| 2656 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tanh.html |
| 2657 | pub extern fn tanh(x: f64) f64; |
| 2658 | |
| 2659 | /// float tanhf(float x); |
| 2660 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tanhf.html |
| 2661 | pub extern fn tanhf(x: f32) f32; |
| 2662 | |
| 2663 | /// long double tanhl(long double x); |
| 2664 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tanhl.html |
| 2665 | pub extern fn tanhl(x: c_longdouble) c_longdouble; |
| 2666 | |
| 2667 | /// long double tanl(long double x); |
| 2668 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tanl.html |
| 2669 | pub extern fn tanl(x: c_longdouble) c_longdouble; |
| 2670 | |
| 2671 | /// int tcdrain(int fildes); |
| 2672 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tcdrain.html |
| 2673 | pub extern fn tcdrain(fd: c_int) c_int; |
| 2674 | |
| 2675 | /// int tcflow(int fildes, int action); |
| 2676 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tcflow.html |
| 2677 | pub extern fn tcflow(fd: c_int, action: c_int) c_int; |
| 2678 | |
| 2679 | /// int tcflush(int fildes, int queue_selector); |
| 2680 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tcflush.html |
| 2681 | pub extern fn tcflush(fd: c_int, queue_selector: c_int) c_int; |
| 2682 | |
| 2683 | /// pid_t tcgetpgrp(int fildes); |
| 2684 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tcgetpgrp.html |
| 2685 | pub extern fn tcgetpgrp(fd: c_int) pid_t; |
| 2686 | |
| 2687 | /// pid_t tcgetsid(int fildes); |
| 2688 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tcgetsid.html |
| 2689 | pub extern fn tcgetsid(fd: c_int) pid_t; |
| 2690 | |
| 2691 | /// int tcsendbreak(int fildes, int duration); |
| 2692 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tcsendbreak.html |
| 2693 | pub extern fn tcsendbreak(fd: c_int, duration: c_int) c_int; |
| 2694 | |
| 2695 | /// double tgamma(double x); |
| 2696 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tgamma.html |
| 2697 | pub extern fn tgamma(x: f64) f64; |
| 2698 | |
| 2699 | /// float tgammaf(float x); |
| 2700 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tgammaf.html |
| 2701 | pub extern fn tgammaf(x: f32) f32; |
| 2702 | |
| 2703 | /// long double tgammal(long double x); |
| 2704 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tgammal.html |
| 2705 | pub extern fn tgammal(x: c_longdouble) c_longdouble; |
| 2706 | |
| 2707 | /// int toascii(int c); |
| 2708 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/toascii.html |
| 2709 | pub extern fn toascii(c: c_int) c_int; |
| 2710 | |
| 2711 | /// int tolower(int c); |
| 2712 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tolower.html |
| 2713 | pub extern fn tolower(c: c_int) c_int; |
| 2714 | |
| 2715 | /// int tolower_l(int c, locale_t locale); |
| 2716 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tolower_l.html |
| 2717 | pub extern fn tolower_l(c: c_int, locale: locale_t) c_int; |
| 2718 | |
| 2719 | /// int toupper(int c); |
| 2720 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/toupper.html |
| 2721 | pub extern fn toupper(c: c_int) c_int; |
| 2722 | |
| 2723 | /// int toupper_l(int c, locale_t locale); |
| 2724 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/toupper_l.html |
| 2725 | pub extern fn toupper_l(c: c_int, locale: locale_t) c_int; |
| 2726 | |
| 2727 | /// wint_t towlower(wint_t wc); |
| 2728 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/towlower.html |
| 2729 | pub extern fn towlower(wc: wint_t) wint_t; |
| 2730 | |
| 2731 | /// wint_t towlower_l(wint_t wc, locale_t locale); |
| 2732 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/towlower_l.html |
| 2733 | pub extern fn towlower_l(wc: wint_t, locale: locale_t) wint_t; |
| 2734 | |
| 2735 | /// wint_t towupper(wint_t wc); |
| 2736 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/towupper.html |
| 2737 | pub extern fn towupper(wc: wint_t) wint_t; |
| 2738 | |
| 2739 | /// wint_t towupper_l(wint_t wc, locale_t locale); |
| 2740 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/towupper_l.html |
| 2741 | pub extern fn towupper_l(wc: wint_t, locale: locale_t) wint_t; |
| 2742 | |
| 2743 | /// double trunc(double x); |
| 2744 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/trunc.html |
| 2745 | pub extern fn trunc(x: f64) f64; |
| 2746 | |
| 2747 | /// float truncf(float x); |
| 2748 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/truncf.html |
| 2749 | pub extern fn truncf(x: f32) f32; |
| 2750 | |
| 2751 | /// long double truncl(long double x); |
| 2752 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/truncl.html |
| 2753 | pub extern fn truncl(x: c_longdouble) c_longdouble; |
| 2754 | |
| 2755 | /// void tzset(void); |
| 2756 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/tzset.html |
| 2757 | pub extern fn tzset() void; |
| 2758 | |
| 2759 | /// long ulimit(int cmd, ...); |
| 2760 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/ulimit.html |
| 2761 | pub extern fn ulimit(cmd: c_int, ...) c_long; |
| 2762 | |
| 2763 | /// mode_t umask(mode_t cmask); |
| 2764 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/umask.html |
| 2765 | pub extern fn umask(cmask: mode_t) mode_t; |
| 2766 | |
| 2767 | /// int unlinkat(int fd, const char *path, int flag); |
| 2768 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/unlinkat.html |
| 2769 | pub extern fn unlinkat(fd: c_int, name: [*:0]const u8, flag: c_int) c_int; |
| 2770 | |
| 2771 | /// int unlockpt(int fildes); |
| 2772 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/unlockpt.html |
| 2773 | pub extern fn unlockpt(fd: c_int) c_int; |
| 2774 | |
| 2775 | /// locale_t uselocale(locale_t newloc); |
| 2776 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/uselocale.html |
| 2777 | pub extern fn uselocale(newloc: locale_t) locale_t; |
| 2778 | |
| 2779 | /// pid_t waitpid(pid_t pid, int *stat_loc, int options); |
| 2780 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/waitpid.html |
| 2781 | pub extern fn waitpid(pid: pid_t, stat_loc: ?*c_int, options: c_int) pid_t; |
| 2782 | |
| 2783 | /// int wctob(wint_t c); |
| 2784 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/wctob.html |
| 2785 | pub extern fn wctob(c: wint_t) c_int; |
| 2786 | |
| 2787 | /// int wcwidth(wchar_t wc); |
| 2788 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/wcwidth.html |
| 2789 | pub extern fn wcwidth(wc: wchar_t) c_int; |
| 2790 | |
| 2791 | /// ssize_t write(int fildes, const void *buf, size_t nbyte); |
| 2792 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/write.html |
| 2793 | pub extern fn write(fd: c_int, buf: *const anyopaque, n: usize) isize; |
| 2794 | |
| 2795 | /// ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); |
| 2796 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/writev.html |
| 2797 | pub extern fn writev(fd: c_int, iovec: [*]const struct_iovec, count: c_int) isize; |
| 2798 | |
| 2799 | /// double y0(double x); |
| 2800 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/y0.html |
| 2801 | pub extern fn y0(x: f64) f64; |
| 2802 | |
| 2803 | /// double y1(double x); |
| 2804 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/y1.html |
| 2805 | pub extern fn y1(x: f64) f64; |
| 2806 | |
| 2807 | /// double yn(int n, double x); |
| 2808 | /// https://pubs.opengroup.org/onlinepubs/9699919799.orig/functions/yn.html |
| 2809 | pub extern fn yn(n: c_int, x: f64) f64; |
| 2810 | |
| 2811 | // |
| 2812 | // |
| 2813 | |
| 2814 | pub extern fn __errno_location() *c_int; |
| 2815 | pub extern fn gettid() pid_t; |
| 2816 | pub extern fn accept4(socket: c_int, noalias address: ?*struct_sockaddr, noalias address_len: *socklen_t, flags: c_int) c_int; |
| 2817 | pub extern fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int; |
| 2818 | pub extern fn sendfile(out_fd: c_int, in_fd: c_int, offset: ?*const off_t, count: usize) isize; |
| 2819 | pub extern fn getdents(dirfd: c_int, buf: [*]u8, nbytes: usize) c_int; |
| 2820 | pub extern fn sched_getaffinity(pid: pid_t, cpusetsize: usize, mask: *cpu_set_t) c_int; |
| 2821 | pub extern fn getrandom(buf: [*]u8, size: usize, flags: c_uint) isize; |
| 2822 | pub extern fn flock(fd: c_int, op: c_int) c_int; |
| 2823 | pub extern fn copy_file_range(fd_int: c_int, off_in: ?*off_t, fd_out: c_int, off_out: ?*off_t, size: usize, flags: c_uint) isize; |
| 2824 | pub extern fn arc4random_buf(buf: [*]u8, n: usize) void; |
| 2825 | }; |
| 2826 | |
| 2827 | comptime { |
| 2828 | const C = struct { |
| 2829 | fn getdents(dirfd: c_int, buf: [*]u8, nbytes: usize) callconv(.c) c_int { |
| 2830 | const rc = std.os.linux.syscall3(.getdents64, @intCast(dirfd), @intFromPtr(buf), nbytes); |
| 2831 | const signed_r: isize = @bitCast(rc); |
| 2832 | if (signed_r < 0 and signed_r > -4096) { |
| 2833 | libc.__errno_location().* = @intCast(-signed_r); |
| 2834 | return -1; |
| 2835 | } |
| 2836 | return @intCast(rc); |
| 2837 | } |
| 2838 | }; |
| 2839 | if (builtin.abi.isGnu()) @export(&C.getdents, .{ .name = "getdents", .linkage = .weak }); // glibc chooses to only expose this as getdents64 |
| 2840 | } |
| 2841 | |
| 2842 | pub const clock_t = c_long; |
| 2843 | pub const pid_t = c_int; |
| 2844 | pub const gid_t = c_uint; |
| 2845 | pub const uid_t = c_uint; |
| 2846 | pub const struct_group = opaque {}; |
| 2847 | pub const struct_hostent = opaque {}; |
| 2848 | pub const struct_netent = opaque {}; |
| 2849 | pub const struct_protoent = opaque {}; |
| 2850 | pub const struct_passwd = opaque {}; |
| 2851 | pub const struct_servent = opaque {}; |
| 2852 | pub const struct_utmpx = opaque {}; |
| 2853 | pub const wint_t = c_uint; |
| 2854 | pub const struct_if_nameindex = opaque {}; |
| 2855 | pub const struct_lconv = opaque {}; |
| 2856 | pub const FILE = opaque {}; |
| 2857 | pub const locale_t = *const opaque {}; |
| 2858 | pub const nl_catd = *const opaque {}; |
| 2859 | pub const intmax_t = i64; |
| 2860 | pub const wchar_t = c_int; |
| 2861 | pub const mode_t = c_uint; |
| 2862 | pub const socklen_t = c_uint; |
| 2863 | pub const clockid_t = c_int; |
| 2864 | pub const struct_timespec = extern struct { sec: isize, nsec: isize }; |
| 2865 | pub const struct_timeval = linux.timeval; |
| 2866 | pub const DIR = opaque {}; |
| 2867 | pub const time_t = i64; |
| 2868 | pub const div_t = extern struct { quot: c_int, rem: c_int }; |
| 2869 | pub const off_t = i64; |
| 2870 | pub const ino_t = u64; |
| 2871 | pub const dev_t = u64; |
| 2872 | pub const nlink_t = c_ulong; |
| 2873 | pub const blksize_t = c_long; |
| 2874 | pub const blkcnt_t = i64; |
| 2875 | pub const struct_stat = switch (arch) { |
| 2876 | .mips64, .mips64el => extern struct { dev: dev_t, __pad1: [3]c_int, ino: ino_t, mode: mode_t, nlink: nlink_t, uid: uid_t, gid: gid_t, rdev: dev_t, __pad2: [2]c_uint, size: off_t, __pad3: c_int, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, blksize: blksize_t, __pad4: c_uint, blocks: blkcnt_t, __pad5: [14]c_int }, |
| 2877 | .powerpc64, .powerpc64le => extern struct { dev: dev_t, ino: ino_t, nlink: nlink_t, mode: mode_t, uid: uid_t, gid: gid_t, rdev: dev_t, size: off_t, blksize: blksize_t, blocks: blkcnt_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, __unused: [3]c_ulong }, |
| 2878 | .s390x => extern struct { dev: dev_t, ino: ino_t, nlink: nlink_t, mode: mode_t, uid: uid_t, gid: gid_t, rdev: dev_t, size: off_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, blksize: blksize_t, blocks: blkcnt_t, __unused: [3]c_ulong }, |
| 2879 | .x86_64 => extern struct { dev: dev_t, ino: ino_t, nlink: nlink_t, mode: mode_t, uid: uid_t, gid: gid_t, __pad0: c_uint, rdev: dev_t, size: off_t, blksize: blksize_t, blocks: blkcnt_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, __unused: [3]c_long }, |
| 2880 | // generic |
| 2881 | .aarch64, |
| 2882 | .riscv64, |
| 2883 | => extern struct { dev: dev_t, ino: ino_t, mode: mode_t, nlink: nlink_t, uid: uid_t, gid: gid_t, rdev: dev_t, __pad: c_ulonglong, size: off_t, blksize: blksize_t, __pad2: c_int, blocks: blkcnt_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, __unused: [2]c_uint }, |
| 2884 | else => unreachable, |
| 2885 | }; |
| 2886 | pub const struct_iovec = extern struct { base: [*]u8, len: usize }; |
| 2887 | pub const in_addr_t = u32; |
| 2888 | pub const in_port_t = u16; |
| 2889 | pub const sa_family_t = c_ushort; |
| 2890 | pub const struct_in_addr = extern struct { addr: in_addr_t }; |
| 2891 | pub const struct_in6_addr = extern struct { addr: [16]u8 }; |
| 2892 | pub const struct_sockaddr = extern struct { family: AF, data: [14]u8 }; |
| 2893 | pub const struct_sockaddr_in = extern struct { family: AF = .INET, port: in_port_t, addr: struct_in_addr, zero: [8]u8 = @splat(0) }; |
| 2894 | pub const struct_sockaddr_in6 = extern struct { family: AF = .INET6, port: in_port_t, flowinfo: u32, addr: struct_in6_addr, scope_id: u32 }; |
| 2895 | pub const struct_sockaddr_un = extern struct { family: AF = .UNIX, path: [108]u8 }; |
| 2896 | pub const struct_addrinfo = extern struct { flags: c_int, family: c_int, socktype: c_int, protocol: c_int, addrlen: socklen_t, addr: ?*struct_sockaddr, canonname: ?[*:0]u8, next: ?*struct_addrinfo }; |
| 2897 | pub const struct_dirent = extern struct { ino: ino_t, off: off_t, reclen: c_ushort, type: DT, name: [NAME_MAX + 1]u8 }; |
| 2898 | pub const cpu_set_t = [1024 / 8 / @sizeOf(c_ulong)]c_ulong; |
| 2899 | pub const nfds_t = c_ulong; |
| 2900 | pub const struct_pollfd = extern struct { fd: c_int, events: c_short, revents: c_short }; |
| 2901 | pub const struct_tm = extern struct { sec: c_int, min: c_int, hour: c_int, mday: c_int, mon: c_int, year: c_int, wday: c_int, yday: c_int, isdst: c_int, gmtoff: c_long, zone: [*:0]const u8 }; |
| 2902 | |
| 2903 | const impdef = @cImport({ |
| 2904 | @cInclude("pthread.h"); |
| 2905 | }); |
| 2906 | pub const pthread_t = impdef.pthread_t; |
| 2907 | pub const pthread_attr_t = impdef.pthread_attr_t; |
| 2908 | pub const pthread_mutexattr_t = impdef.pthread_mutexattr_t; |
| 2909 | pub const pthread_mutex_t = impdef.pthread_mutex_t; |
| 2910 | pub const pthread_condattr_t = impdef.pthread_condattr_t; |
| 2911 | pub const pthread_cond_t = impdef.pthread_cond_t; |
| 2912 | pub const pthread_rwlockattr_t = impdef.pthread_rwlockattr_t; |
| 2913 | pub const pthread_rwlock_t = impdef.pthread_rwlock_t; |
| 2914 | |
| 2915 | pub const AT = struct { |
| 2916 | pub const FDCWD = -100; |
| 2917 | pub const SYMLINK_NOFOLLOW = 0x100; |
| 2918 | pub const REMOVEDIR = 0x200; |
| 2919 | pub const SYMLINK_FOLLOW = 0x400; |
| 2920 | pub const EACCESS = 0x200; |
| 2921 | }; |
| 2922 | |
| 2923 | pub const O = struct { |
| 2924 | pub const CREAT = if (arch != .mips64el) 0o100 else 0o400; |
| 2925 | pub const EXCL = if (arch != .mips64el) 0o200 else 0o2000; |
| 2926 | pub const NOCTTY = if (arch != .mips64el) 0o400 else 0o4000; |
| 2927 | pub const TRUNC = 0o1000; |
| 2928 | pub const APPEND = if (arch != .mips64el) 0o2000 else 0o010; |
| 2929 | pub const NONBLOCK = if (arch != .mips64el) 0o4000 else 0o200; |
| 2930 | pub const DSYNC = if (arch != .mips64el) 0o10000 else 0o020; |
| 2931 | pub const SYNC = if (arch != .mips64el) 0o4010000 else 0o40020; |
| 2932 | pub const RSYNC = if (arch != .mips64el) 0o4010000 else 0o40020; |
| 2933 | pub const DIRECTORY = if (arch == .aarch64 or arch == .powerpc64le) 0o40000 else 0o200000; |
| 2934 | pub const NOFOLLOW = if (arch == .aarch64 or arch == .powerpc64le) 0o100000 else 0o400000; |
| 2935 | pub const CLOEXEC = 0o2000000; |
| 2936 | pub const ASYNC = if (arch != .mips64el) 0o20000 else 0o10000; |
| 2937 | pub const DIRECT = switch (arch) { |
| 2938 | .x86_64, .riscv64 => 0o40000, // generic |
| 2939 | .aarch64 => 0o200000, |
| 2940 | .powerpc64le => 0o400000, |
| 2941 | .mips64el => 0o100000, |
| 2942 | else => @compileError("TODO"), |
| 2943 | }; |
| 2944 | pub const LARGEFILE = switch (arch) { |
| 2945 | .x86_64, .riscv64 => 0o100000, // generic |
| 2946 | .aarch64 => 0o400000, |
| 2947 | .powerpc64le => 0o200000, |
| 2948 | .mips64el => 0o20000, |
| 2949 | else => @compileError("TODO"), |
| 2950 | }; |
| 2951 | pub const NOATIME = 0o1000000; |
| 2952 | pub const PATH = 0o10000000; |
| 2953 | pub const TMPFILE = if (arch == .aarch64 or arch == .powerpc64le) 0o20040000 else 0o20200000; |
| 2954 | pub const NDELAY = O.NONBLOCK; |
| 2955 | pub const SEARCH = O.PATH; |
| 2956 | pub const EXEC = O.PATH; |
| 2957 | pub const TTY_INIT = 0; |
| 2958 | pub const ACCMODE = (3 | O.SEARCH); |
| 2959 | pub const RDONLY = 0; |
| 2960 | pub const WRONLY = 1; |
| 2961 | pub const RDWR = 2; |
| 2962 | }; |
| 2963 | |
| 2964 | pub const S = struct { |
| 2965 | pub const IFMT = 0o170000; |
| 2966 | pub const IFDIR = 0o040000; |
| 2967 | pub const IFCHR = 0o020000; |
| 2968 | pub const IFBLK = 0o060000; |
| 2969 | pub const IFREG = 0o100000; |
| 2970 | pub const IFIFO = 0o010000; |
| 2971 | pub const IFLNK = 0o120000; |
| 2972 | pub const IFSOCK = 0o140000; |
| 2973 | pub const IFWHT = 0o160000; //unused |
| 2974 | |
| 2975 | pub const ISUID = 0o4000; |
| 2976 | pub const ISGID = 0o2000; |
| 2977 | pub const ISVTX = 0o1000; |
| 2978 | pub const IRUSR = 0o400; |
| 2979 | pub const IWUSR = 0o200; |
| 2980 | pub const IXUSR = 0o100; |
| 2981 | pub const IRWXU = 0o700; |
| 2982 | pub const IRGRP = 0o040; |
| 2983 | pub const IWGRP = 0o020; |
| 2984 | pub const IXGRP = 0o010; |
| 2985 | pub const IRWXG = 0o070; |
| 2986 | pub const IROTH = 0o004; |
| 2987 | pub const IWOTH = 0o002; |
| 2988 | pub const IXOTH = 0o001; |
| 2989 | pub const IRWXO = 0o007; |
| 2990 | }; |
| 2991 | |
| 2992 | pub const CLOCK = struct { |
| 2993 | pub const REALTIME = 0; |
| 2994 | pub const MONOTONIC = 1; |
| 2995 | pub const PROCESS_CPUTIME_ID = 2; |
| 2996 | pub const THREAD_CPUTIME_ID = 3; |
| 2997 | pub const MONOTONIC_RAW = 4; |
| 2998 | pub const REALTIME_COARSE = 5; |
| 2999 | pub const MONOTONIC_COARSE = 6; |
| 3000 | pub const BOOTTIME = 7; |
| 3001 | pub const REALTIME_ALARM = 8; |
| 3002 | pub const BOOTTIME_ALARM = 9; |
| 3003 | pub const SGI_CYCLE = 10; |
| 3004 | pub const TAI = 11; |
| 3005 | }; |
| 3006 | |
| 3007 | pub const MAP = struct { |
| 3008 | pub const FAILED = -1; |
| 3009 | |
| 3010 | pub const SHARED = 0x01; |
| 3011 | pub const PRIVATE = 0x02; |
| 3012 | pub const SHARED_VALIDATE = 0x03; |
| 3013 | pub const TYPE = 0x0f; |
| 3014 | pub const FIXED = 0x10; |
| 3015 | pub const ANON = 0x20; |
| 3016 | pub const ANONYMOUS = ANON; |
| 3017 | pub const NORESERVE = 0x4000; |
| 3018 | pub const GROWSDOWN = 0x0100; |
| 3019 | pub const DENYWRITE = 0x0800; |
| 3020 | pub const EXECUTABLE = 0x1000; |
| 3021 | pub const LOCKED = 0x2000; |
| 3022 | pub const POPULATE = 0x8000; |
| 3023 | pub const NONBLOCK = 0x10000; |
| 3024 | pub const STACK = 0x20000; |
| 3025 | pub const HUGETLB = 0x40000; |
| 3026 | pub const SYNC = 0x80000; |
| 3027 | pub const FIXED_NOREPLACE = 0x100000; |
| 3028 | pub const FILE = 0; |
| 3029 | |
| 3030 | pub const MAP_HUGE_SHIFT = 26; |
| 3031 | pub const MAP_HUGE_MASK = 0x3f; |
| 3032 | pub const MAP_HUGE_16KB = 14 << 26; |
| 3033 | pub const MAP_HUGE_64KB = 16 << 26; |
| 3034 | pub const MAP_HUGE_512KB = 19 << 26; |
| 3035 | pub const MAP_HUGE_1MB = 20 << 26; |
| 3036 | pub const MAP_HUGE_2MB = 21 << 26; |
| 3037 | pub const MAP_HUGE_8MB = 23 << 26; |
| 3038 | pub const MAP_HUGE_16MB = 24 << 26; |
| 3039 | pub const MAP_HUGE_32MB = 25 << 26; |
| 3040 | pub const MAP_HUGE_256MB = 28 << 26; |
| 3041 | pub const MAP_HUGE_512MB = 29 << 26; |
| 3042 | pub const MAP_HUGE_1GB = 30 << 26; |
| 3043 | pub const MAP_HUGE_2GB = 31 << 26; |
| 3044 | pub const MAP_HUGE_16GB = 34 << 26; |
| 3045 | }; |
| 3046 | |
| 3047 | pub const PROT = struct { |
| 3048 | pub const NONE = 0; |
| 3049 | pub const READ = 1; |
| 3050 | pub const WRITE = 2; |
| 3051 | pub const EXEC = 4; |
| 3052 | pub const GROWSDOWN = 0x01000000; |
| 3053 | pub const GROWSUP = 0x02000000; |
| 3054 | }; |
| 3055 | |
| 3056 | pub const NAME_MAX = 255; |
| 3057 | pub const PATH_MAX = 4096; |
| 3058 | pub const NGROUPS_MAX = 32; |
| 3059 | pub const ARG_MAX = 131072; |
| 3060 | pub const IOV_MAX = 1024; |
| 3061 | pub const SYMLOOP_MAX = 40; |
| 3062 | pub const TZNAME_MAX = 6; |
| 3063 | pub const TTY_NAME_MAX = 32; |
| 3064 | pub const HOST_NAME_MAX = 255; |
| 3065 | |
| 3066 | pub const AF = enum(sa_family_t) { |
| 3067 | UNSPEC = 0, |
| 3068 | LOCAL = 1, |
| 3069 | INET = 2, |
| 3070 | AX25 = 3, |
| 3071 | IPX = 4, |
| 3072 | APPLETALK = 5, |
| 3073 | NETROM = 6, |
| 3074 | BRIDGE = 7, |
| 3075 | ATMPVC = 8, |
| 3076 | X25 = 9, |
| 3077 | INET6 = 10, |
| 3078 | ROSE = 11, |
| 3079 | DECnet = 12, |
| 3080 | NETBEUI = 13, |
| 3081 | SECURITY = 14, |
| 3082 | KEY = 15, |
| 3083 | NETLINK = 16, |
| 3084 | PACKET = 17, |
| 3085 | ASH = 18, |
| 3086 | ECONET = 19, |
| 3087 | ATMSVC = 20, |
| 3088 | RDS = 21, |
| 3089 | SNA = 22, |
| 3090 | IRDA = 23, |
| 3091 | PPPOX = 24, |
| 3092 | WANPIPE = 25, |
| 3093 | LLC = 26, |
| 3094 | IB = 27, |
| 3095 | MPLS = 28, |
| 3096 | CAN = 29, |
| 3097 | TIPC = 30, |
| 3098 | BLUETOOTH = 31, |
| 3099 | IUCV = 32, |
| 3100 | RXRPC = 33, |
| 3101 | ISDN = 34, |
| 3102 | PHONET = 35, |
| 3103 | IEEE802154 = 36, |
| 3104 | CAIF = 37, |
| 3105 | ALG = 38, |
| 3106 | NFC = 39, |
| 3107 | VSOCK = 40, |
| 3108 | KCM = 41, |
| 3109 | QIPCRTR = 42, |
| 3110 | SMC = 43, |
| 3111 | XDP = 44, |
| 3112 | |
| 3113 | pub const UNIX: AF = .LOCAL; |
| 3114 | pub const FILE: AF = .LOCAL; |
| 3115 | pub const ROUTE: AF = .NETLINK; |
| 3116 | }; |
| 3117 | |
| 3118 | pub const SOCK = struct { |
| 3119 | pub const STREAM = 1; |
| 3120 | pub const DGRAM = 2; |
| 3121 | pub const RAW = 3; |
| 3122 | pub const RDM = 4; |
| 3123 | pub const SEQPACKET = 5; |
| 3124 | pub const DCCP = 6; |
| 3125 | pub const PACKET = 10; |
| 3126 | pub const CLOEXEC = 0o2000000; |
| 3127 | pub const NONBLOCK = 0o4000; |
| 3128 | }; |
| 3129 | |
| 3130 | pub const SHUT = enum(c_int) { |
| 3131 | RD = 0, |
| 3132 | WR = 1, |
| 3133 | RDWR = 2, |
| 3134 | }; |
| 3135 | |
| 3136 | pub const IPPROTO = struct { |
| 3137 | pub const IP = 0; |
| 3138 | pub const HOPOPTS = 0; |
| 3139 | pub const ICMP = 1; |
| 3140 | pub const IGMP = 2; |
| 3141 | pub const IPIP = 4; |
| 3142 | pub const TCP = 6; |
| 3143 | pub const EGP = 8; |
| 3144 | pub const PUP = 12; |
| 3145 | pub const UDP = 17; |
| 3146 | pub const IDP = 22; |
| 3147 | pub const TP = 29; |
| 3148 | pub const DCCP = 33; |
| 3149 | pub const IPV6 = 41; |
| 3150 | pub const ROUTING = 43; |
| 3151 | pub const FRAGMENT = 44; |
| 3152 | pub const RSVP = 46; |
| 3153 | pub const GRE = 47; |
| 3154 | pub const ESP = 50; |
| 3155 | pub const AH = 51; |
| 3156 | pub const ICMPV6 = 58; |
| 3157 | pub const NONE = 59; |
| 3158 | pub const DSTOPTS = 60; |
| 3159 | pub const MTP = 92; |
| 3160 | pub const BEETPH = 94; |
| 3161 | pub const ENCAP = 98; |
| 3162 | pub const PIM = 103; |
| 3163 | pub const COMP = 108; |
| 3164 | pub const SCTP = 132; |
| 3165 | pub const MH = 135; |
| 3166 | pub const UDPLITE = 136; |
| 3167 | pub const MPLS = 137; |
| 3168 | pub const ETHERNET = 143; |
| 3169 | pub const RAW = 255; |
| 3170 | pub const MPTCP = 262; |
| 3171 | }; |
| 3172 | |
| 3173 | pub const SOL = struct { |
| 3174 | pub const SOCKET = 1; |
| 3175 | pub const IP = 0; |
| 3176 | pub const IPV6 = 41; |
| 3177 | pub const ICMPV6 = 58; |
| 3178 | pub const RAW = 255; |
| 3179 | pub const DECNET = 261; |
| 3180 | pub const X25 = 262; |
| 3181 | pub const PACKET = 263; |
| 3182 | pub const ATM = 264; |
| 3183 | pub const AAL = 265; |
| 3184 | pub const IRDA = 266; |
| 3185 | pub const NETBEUI = 267; |
| 3186 | pub const LLC = 268; |
| 3187 | pub const DCCP = 269; |
| 3188 | pub const NETLINK = 270; |
| 3189 | pub const TIPC = 271; |
| 3190 | pub const RXRPC = 272; |
| 3191 | pub const PPPOL2TP = 273; |
| 3192 | pub const BLUETOOTH = 274; |
| 3193 | pub const PNPIPE = 275; |
| 3194 | pub const RDS = 276; |
| 3195 | pub const IUCV = 277; |
| 3196 | pub const CAIF = 278; |
| 3197 | pub const ALG = 279; |
| 3198 | pub const NFC = 280; |
| 3199 | pub const KCM = 281; |
| 3200 | pub const TLS = 282; |
| 3201 | pub const XDP = 283; |
| 3202 | }; |
| 3203 | |
| 3204 | pub const SO = struct { |
| 3205 | pub const DEBUG = 1; |
| 3206 | pub const REUSEADDR = 2; |
| 3207 | pub const TYPE = 3; |
| 3208 | pub const ERROR = 4; |
| 3209 | pub const DONTROUTE = 5; |
| 3210 | pub const BROADCAST = 6; |
| 3211 | pub const SNDBUF = 7; |
| 3212 | pub const RCVBUF = 8; |
| 3213 | pub const KEEPALIVE = 9; |
| 3214 | pub const OOBINLINE = 10; |
| 3215 | pub const NO_CHECK = 11; |
| 3216 | pub const PRIORITY = 12; |
| 3217 | pub const LINGER = 13; |
| 3218 | pub const BSDCOMPAT = 14; |
| 3219 | pub const REUSEPORT = 15; |
| 3220 | pub const PASSCRED = 16; |
| 3221 | pub const PEERCRED = 17; |
| 3222 | pub const RCVLOWAT = 18; |
| 3223 | pub const SNDLOWAT = 19; |
| 3224 | |
| 3225 | pub const RCVTIMEO = 20; |
| 3226 | pub const SNDTIMEO = 21; |
| 3227 | |
| 3228 | pub const ACCEPTCONN = 30; |
| 3229 | pub const PEERSEC = 31; |
| 3230 | pub const SNDBUFFORCE = 32; |
| 3231 | pub const RCVBUFFORCE = 33; |
| 3232 | pub const PROTOCOL = 38; |
| 3233 | pub const DOMAIN = 39; |
| 3234 | }; |
| 3235 | |
| 3236 | pub const DT = enum(u8) { |
| 3237 | UNKNOWN = 0, |
| 3238 | FIFO = 1, |
| 3239 | CHR = 2, |
| 3240 | DIR = 4, |
| 3241 | BLK = 6, |
| 3242 | REG = 8, |
| 3243 | LNK = 10, |
| 3244 | SOCK = 12, |
| 3245 | WHT = 14, |
| 3246 | }; |
| 3247 | |
| 3248 | pub const GRND = struct { |
| 3249 | pub const NONBLOCK = 0x0001; |
| 3250 | pub const RANDOM = 0x0002; |
| 3251 | pub const INSECURE = 0x0004; |
| 3252 | }; |
| 3253 | |
| 3254 | pub const LOCK = struct { |
| 3255 | pub const SH = 1; |
| 3256 | pub const EX = 2; |
| 3257 | pub const NB = 4; |
| 3258 | pub const UN = 8; |
| 3259 | }; |
| 3260 | |
| 3261 | pub const SIG = struct { |
| 3262 | pub const HUP = 1; |
| 3263 | pub const INT = 2; |
| 3264 | pub const QUIT = 3; |
| 3265 | pub const ILL = 4; |
| 3266 | pub const TRAP = 5; |
| 3267 | pub const ABRT = 6; |
| 3268 | pub const IOT = ABRT; |
| 3269 | pub const BUS = 7; |
| 3270 | pub const FPE = 8; |
| 3271 | pub const KILL = 9; |
| 3272 | pub const USR1 = 10; |
| 3273 | pub const SEGV = 11; |
| 3274 | pub const USR2 = 12; |
| 3275 | pub const PIPE = 13; |
| 3276 | pub const ALRM = 14; |
| 3277 | pub const TERM = 15; |
| 3278 | pub const STKFLT = 16; |
| 3279 | pub const CHLD = 17; |
| 3280 | pub const CONT = 18; |
| 3281 | pub const STOP = 19; |
| 3282 | pub const TSTP = 20; |
| 3283 | pub const TTIN = 21; |
| 3284 | pub const TTOU = 22; |
| 3285 | pub const URG = 23; |
| 3286 | pub const XCPU = 24; |
| 3287 | pub const XFSZ = 25; |
| 3288 | pub const VTALRM = 26; |
| 3289 | pub const PROF = 27; |
| 3290 | pub const WINCH = 28; |
| 3291 | pub const IO = 29; |
| 3292 | pub const POLL = 29; |
| 3293 | pub const PWR = 30; |
| 3294 | pub const SYS = 31; |
| 3295 | pub const UNUSED = SYS; |
| 3296 | }; |
| 3297 | |
| 3298 | pub const POLL = struct { |
| 3299 | pub const IN = 0x001; |
| 3300 | pub const PRI = 0x002; |
| 3301 | pub const OUT = 0x004; |
| 3302 | pub const ERR = 0x008; |
| 3303 | pub const HUP = 0x010; |
| 3304 | pub const NVAL = 0x020; |
| 3305 | pub const RDNORM = 0x040; |
| 3306 | pub const RDBAND = 0x080; |
| 3307 | pub const WRNORM = if (arch.isMIPS()) OUT else 0x100; |
| 3308 | pub const WRBAND = if (arch.isMIPS()) 0x100 else 0x200; |
| 3309 | pub const MSG = 0x400; |
| 3310 | pub const RDHUP = 0x2000; |
| 3311 | }; |
| 3312 | |
| 3313 | pub const W = struct { |
| 3314 | pub const NOHANG = 1; |
| 3315 | pub const UNTRACED = 2; |
| 3316 | pub const STOPPED = 2; |
| 3317 | pub const EXITED = 4; |
| 3318 | pub const CONTINUED = 8; |
| 3319 | pub const NOWAIT = 0x1000000; |
| 3320 | |
| 3321 | pub fn EXITSTATUS(s: c_int) u8 { |
| 3322 | return @intCast((s & 0xff00) >> 8); |
| 3323 | } |
| 3324 | pub fn TERMSIG(s: c_int) u8 { |
| 3325 | return @intCast(s & 0x7f); |
| 3326 | } |
| 3327 | pub fn STOPSIG(s: c_int) u8 { |
| 3328 | return EXITSTATUS(s); |
| 3329 | } |
| 3330 | pub fn COREDUMP(s: c_int) c_uint { |
| 3331 | return s & 0x80; |
| 3332 | } |
| 3333 | pub fn IFEXITED(s: c_int) bool { |
| 3334 | return TERMSIG(s) == 0; |
| 3335 | } |
| 3336 | pub fn IFSTOPPED(s: c_int) bool { |
| 3337 | return ((s & 0xffff) *% 0x10001) >> 8 > 0x7f00; |
| 3338 | } |
| 3339 | pub fn IFSIGNALED(s: c_int) bool { |
| 3340 | return s & 0xffff -% 1 < 0xff; |
| 3341 | } |
| 3342 | pub fn IFCONTINUED(s: c_int) bool { |
| 3343 | return s == 0xffff; |
| 3344 | } |
| 3345 | }; |
| 3346 | |
| 3347 | pub const SEEK = struct { |
| 3348 | pub const SET = 0; |
| 3349 | pub const CUR = 1; |
| 3350 | pub const END = 2; |
| 3351 | pub const DATA = 3; |
| 3352 | pub const HOLE = 4; |
| 3353 | }; |
| 3354 | |
| 3355 | pub const IPV6 = struct { |
| 3356 | pub const ADDRFORM = 1; |
| 3357 | pub const @"2292PKTINFO" = 2; |
| 3358 | pub const @"2292HOPOPTS" = 3; |
| 3359 | pub const @"2292DSTOPTS" = 4; |
| 3360 | pub const @"2292RTHDR" = 5; |
| 3361 | pub const @"2292PKTOPTIONS" = 6; |
| 3362 | pub const CHECKSUM = 7; |
| 3363 | pub const @"2292HOPLIMIT" = 8; |
| 3364 | pub const NEXTHOP = 9; |
| 3365 | pub const AUTHHDR = 10; |
| 3366 | pub const UNICAST_HOPS = 16; |
| 3367 | pub const MULTICAST_IF = 17; |
| 3368 | pub const MULTICAST_HOPS = 18; |
| 3369 | pub const MULTICAST_LOOP = 19; |
| 3370 | pub const JOIN_GROUP = 20; |
| 3371 | pub const LEAVE_GROUP = 21; |
| 3372 | pub const ROUTER_ALERT = 22; |
| 3373 | pub const MTU_DISCOVER = 23; |
| 3374 | pub const MTU = 24; |
| 3375 | pub const RECVERR = 25; |
| 3376 | pub const V6ONLY = 26; |
| 3377 | pub const JOIN_ANYCAST = 27; |
| 3378 | pub const LEAVE_ANYCAST = 28; |
| 3379 | pub const MULTICAST_ALL = 29; |
| 3380 | pub const ROUTER_ALERT_ISOLATE = 30; |
| 3381 | pub const IPSEC_POLICY = 34; |
| 3382 | pub const XFRM_POLICY = 35; |
| 3383 | pub const HDRINCL = 36; |
| 3384 | pub const RECVPKTINFO = 49; |
| 3385 | pub const PKTINFO = 50; |
| 3386 | pub const RECVHOPLIMIT = 51; |
| 3387 | pub const HOPLIMIT = 52; |
| 3388 | pub const RECVHOPOPTS = 53; |
| 3389 | pub const HOPOPTS = 54; |
| 3390 | pub const RTHDRDSTOPTS = 55; |
| 3391 | pub const RECVRTHDR = 56; |
| 3392 | pub const RTHDR = 57; |
| 3393 | pub const RECVDSTOPTS = 58; |
| 3394 | pub const DSTOPTS = 59; |
| 3395 | pub const RECVPATHMTU = 60; |
| 3396 | pub const PATHMTU = 61; |
| 3397 | pub const DONTFRAG = 62; |
| 3398 | pub const RECVTCLASS = 66; |
| 3399 | pub const TCLASS = 67; |
| 3400 | pub const AUTOFLOWLABEL = 70; |
| 3401 | pub const ADDR_PREFERENCES = 72; |
| 3402 | pub const MINHOPCOUNT = 73; |
| 3403 | pub const ORIGDSTADDR = 74; |
| 3404 | pub const RECVORIGDSTADDR = ORIGDSTADDR; |
| 3405 | pub const TRANSPARENT = 75; |
| 3406 | pub const UNICAST_IF = 76; |
| 3407 | pub const RECVFRAGSIZE = 77; |
| 3408 | pub const FREEBIND = 78; |
| 3409 | }; |
| 3410 | |
| 3411 | pub fn getpid() pid_t { |
| 3412 | return libc.getpid(); |
| 3413 | } |
| 3414 | pub fn exit(status: c_int) noreturn { |
| 3415 | return libc.exit(status); |
| 3416 | } |
| 3417 | pub fn getenv(name: [:0]const u8) ?[:0]u8 { |
| 3418 | return std.mem.sliceTo(libc.getenv(name.ptr) orelse return null, 0); |
| 3419 | } |
| 3420 | pub fn openat(fd: c_int, file: [*:0]const u8, oflag: c_int) errno.Error!c_int { |
| 3421 | const rc = libc.openat(fd, file, oflag); |
| 3422 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3423 | return rc; |
| 3424 | } |
| 3425 | pub fn openat4(fd: c_int, file: [*:0]const u8, oflag: c_int, mode: mode_t) errno.Error!c_int { |
| 3426 | const rc = libc.openat(fd, file, oflag, mode); |
| 3427 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3428 | return rc; |
| 3429 | } |
| 3430 | pub fn close(fd: c_int) errno.Error!void { |
| 3431 | const rc = libc.close(fd); |
| 3432 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3433 | std.debug.assert(rc == 0); |
| 3434 | } |
| 3435 | pub fn read(fd: c_int, buf: []u8) errno.Error!usize { |
| 3436 | const rc = libc.read(fd, buf.ptr, buf.len); |
| 3437 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3438 | std.debug.assert(rc >= 0); |
| 3439 | return @intCast(rc); |
| 3440 | } |
| 3441 | pub fn fstat(fd: c_int) errno.Error!struct_stat { |
| 3442 | var buf: struct_stat = undefined; |
| 3443 | const rc = libc.fstat(fd, &buf); |
| 3444 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3445 | std.debug.assert(rc == 0); |
| 3446 | return buf; |
| 3447 | } |
| 3448 | pub fn readv(fd: c_int, bufs: []const struct_iovec) errno.Error!usize { |
| 3449 | std.debug.assert(bufs.len > 0); |
| 3450 | std.debug.assert(bufs.len <= IOV_MAX); |
| 3451 | const rc = libc.readv(fd, bufs.ptr, @intCast(bufs.len)); |
| 3452 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3453 | std.debug.assert(rc >= 0); |
| 3454 | return @intCast(rc); |
| 3455 | } |
| 3456 | pub fn mkdirat(fd: c_int, path: [*:0]const u8, mode: mode_t) errno.Error!void { |
| 3457 | const rc = libc.mkdirat(fd, path, mode); |
| 3458 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3459 | std.debug.assert(rc == 0); |
| 3460 | } |
| 3461 | pub fn pthread_self() pthread_t { |
| 3462 | return libc.pthread_self(); |
| 3463 | } |
| 3464 | pub fn gettid() pid_t { |
| 3465 | return libc.gettid(); |
| 3466 | } |
| 3467 | pub fn fstatat(fd: c_int, path: [*:0]const u8, flag: c_int) errno.Error!struct_stat { |
| 3468 | var buf: struct_stat = undefined; |
| 3469 | const rc = libc.fstatat(fd, path, &buf, flag); |
| 3470 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3471 | std.debug.assert(rc == 0); |
| 3472 | return buf; |
| 3473 | } |
| 3474 | pub fn socket(domain: AF, ty: c_int, protocol: c_int) errno.Error!c_uint { |
| 3475 | const rc = libc.socket(@intFromEnum(domain), ty, protocol); |
| 3476 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3477 | std.debug.assert(rc > 0); |
| 3478 | return @intCast(rc); |
| 3479 | } |
| 3480 | pub fn listen(socketfd: c_uint, backlog: c_int) errno.Error!void { |
| 3481 | const rc = libc.listen(@intCast(socketfd), backlog); |
| 3482 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3483 | std.debug.assert(rc == 0); |
| 3484 | } |
| 3485 | pub fn bind(socketfd: c_uint, address: *const struct_sockaddr, address_len: socklen_t) errno.Error!void { |
| 3486 | const rc = libc.bind(@intCast(socketfd), address, address_len); |
| 3487 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3488 | std.debug.assert(rc == 0); |
| 3489 | } |
| 3490 | pub fn connect(socketfd: c_uint, address: *const struct_sockaddr, address_len: socklen_t) errno.Error!void { |
| 3491 | const rc = libc.connect(@intCast(socketfd), address, address_len); |
| 3492 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3493 | std.debug.assert(rc == 0); |
| 3494 | } |
| 3495 | pub fn shutdown(socketfd: c_uint, how: SHUT) errno.Error!void { |
| 3496 | const rc = libc.shutdown(@intCast(socketfd), @intFromEnum(how)); |
| 3497 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3498 | std.debug.assert(rc == 0); |
| 3499 | } |
| 3500 | pub fn setsockopt(socketfd: c_uint, level: c_int, optname: c_int, opaque_opt: []const u8) errno.Error!void { |
| 3501 | const rc = libc.setsockopt(@intCast(socketfd), level, optname, opaque_opt.ptr, @intCast(opaque_opt.len)); |
| 3502 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3503 | std.debug.assert(rc == 0); |
| 3504 | } |
| 3505 | pub fn accept4(socketfd: c_uint, noalias address: ?*struct_sockaddr, noalias address_len: *socklen_t, flags: c_int) errno.Error!c_uint { |
| 3506 | const rc = libc.accept4(@intCast(socketfd), address, address_len, flags); |
| 3507 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3508 | std.debug.assert(rc > 0); |
| 3509 | return @intCast(rc); |
| 3510 | } |
| 3511 | pub fn send(socketfd: c_uint, buffer: []const u8, flags: c_int) errno.Error!usize { |
| 3512 | const rc = libc.send(@intCast(socketfd), buffer.ptr, buffer.len, flags); |
| 3513 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3514 | std.debug.assert(rc >= 0); |
| 3515 | return @intCast(rc); |
| 3516 | } |
| 3517 | pub fn recv(socketfd: c_uint, buffer: []u8, flags: c_int) errno.Error!usize { |
| 3518 | const rc = libc.recv(@intCast(socketfd), buffer.ptr, buffer.len, flags); |
| 3519 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3520 | std.debug.assert(rc >= 0); |
| 3521 | return @intCast(rc); |
| 3522 | } |
| 3523 | pub fn getaddrinfo(noalias nodename: ?[*:0]const u8, noalias servname: ?[*:0]const u8, noalias req: ?*const struct_addrinfo) eai.Error!*const struct_addrinfo { |
| 3524 | var pai: *const struct_addrinfo = undefined; |
| 3525 | var hints = std.mem.zeroes(struct_addrinfo); |
| 3526 | const rc = libc.getaddrinfo(nodename, servname, req orelse &hints, &pai); |
| 3527 | if (rc < 0) return eai.fromInt(rc); |
| 3528 | std.debug.assert(rc == 0); |
| 3529 | return pai; |
| 3530 | } |
| 3531 | pub fn freeaddrinfo(ai: *const struct_addrinfo) void { |
| 3532 | return libc.freeaddrinfo(ai); |
| 3533 | } |
| 3534 | pub fn clock_gettime(clock_id: clockid_t) !struct_timespec { |
| 3535 | var tp: struct_timespec = undefined; |
| 3536 | const rc = libc.clock_gettime(clock_id, &tp); |
| 3537 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3538 | std.debug.assert(rc == 0); |
| 3539 | return tp; |
| 3540 | } |
| 3541 | pub fn memfd_create(name: [*:0]const u8, flags: c_uint) !c_int { |
| 3542 | const rc = libc.memfd_create(name, flags); |
| 3543 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3544 | std.debug.assert(rc >= 0); |
| 3545 | return rc; |
| 3546 | } |
| 3547 | pub fn readlinkat(dirfd: c_int, noalias path: [*:0]const u8, noalias buf: []u8) ![:0]u8 { |
| 3548 | const rc = libc.readlinkat(dirfd, path, buf.ptr, buf.len); |
| 3549 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3550 | std.debug.assert(rc >= 0); |
| 3551 | buf[@intCast(rc)] = 0; |
| 3552 | return buf[0..@intCast(rc) :0]; |
| 3553 | } |
| 3554 | pub fn write(fd: c_int, buf: []const u8) !usize { |
| 3555 | const rc = libc.write(fd, buf.ptr, buf.len); |
| 3556 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3557 | std.debug.assert(rc >= 0); |
| 3558 | return @intCast(rc); |
| 3559 | } |
| 3560 | pub fn writev(fd: c_int, iovec: []const struct_iovec) !usize { |
| 3561 | const rc = libc.writev(fd, iovec.ptr, @intCast(iovec.len)); |
| 3562 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3563 | std.debug.assert(rc >= 0); |
| 3564 | return @intCast(rc); |
| 3565 | } |
| 3566 | pub fn getsockname(socketfd: c_uint, noalias address: *struct_sockaddr, noalias address_len: *socklen_t) errno.Error!void { |
| 3567 | const rc = libc.getsockname(@intCast(socketfd), address, address_len); |
| 3568 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3569 | std.debug.assert(rc == 0); |
| 3570 | } |
| 3571 | pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: ?*const off_t, count: usize) errno.Error!usize { |
| 3572 | const rc = libc.sendfile(out_fd, in_fd, offset, count); |
| 3573 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3574 | std.debug.assert(rc >= 0); |
| 3575 | return @intCast(rc); |
| 3576 | } |
| 3577 | pub fn getdents(dirfd: c_int, buf: []u8) errno.Error!usize { |
| 3578 | const rc = libc.getdents(dirfd, buf.ptr, buf.len); |
| 3579 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3580 | std.debug.assert(rc >= 0); |
| 3581 | return @intCast(rc); |
| 3582 | } |
| 3583 | pub fn renameat(oldfd: c_int, old: [*:0]const u8, newfd: c_int, new: [*:0]const u8) !void { |
| 3584 | const rc = libc.renameat(oldfd, old, newfd, new); |
| 3585 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3586 | std.debug.assert(rc == 0); |
| 3587 | } |
| 3588 | pub fn mmap(addr: ?*anyopaque, len: usize, prot: c_int, flags: c_int, fd: c_int, offset: off_t) errno.Error![]u8 { |
| 3589 | const rc = libc.mmap(addr, len, prot, flags, fd, offset); |
| 3590 | if (@intFromPtr(rc) == MAP.FAILED) return errno.fromInt(errno.fromLibC()); |
| 3591 | const ptr: [*]u8 = @ptrCast(rc); |
| 3592 | return ptr[0..len]; |
| 3593 | } |
| 3594 | pub fn munmap(addr: *const anyopaque, len: usize) errno.Error!void { |
| 3595 | const rc = libc.munmap(addr, len); |
| 3596 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3597 | std.debug.assert(rc == 0); |
| 3598 | } |
| 3599 | pub fn sched_getaffinity(pid: pid_t) !cpu_set_t { |
| 3600 | var cpuset: cpu_set_t = undefined; |
| 3601 | const rc = libc.sched_getaffinity(pid, @sizeOf(cpu_set_t), &cpuset); |
| 3602 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3603 | std.debug.assert(rc == 0); |
| 3604 | return cpuset; |
| 3605 | } |
| 3606 | pub fn mkdtemp(template: [*:0]u8) ![*:0]u8 { |
| 3607 | const rc = libc.mkdtemp(template); |
| 3608 | if (rc == null) return errno.fromInt(errno.fromLibC()); |
| 3609 | return rc.?; |
| 3610 | } |
| 3611 | pub fn getrandom(buf: []u8, flags: c_uint) ![]u8 { |
| 3612 | const rc = libc.getrandom(buf.ptr, buf.len, flags); |
| 3613 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3614 | std.debug.assert(rc >= 0); |
| 3615 | return buf[0..@intCast(rc)]; |
| 3616 | } |
| 3617 | pub fn flock(fd: c_int, op: c_int) !void { |
| 3618 | const rc = libc.flock(fd, op); |
| 3619 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3620 | std.debug.assert(rc == 0); |
| 3621 | } |
| 3622 | pub fn futimens(fd: c_int, times: [2]struct_timespec) !void { |
| 3623 | const rc = libc.futimens(fd, &times); |
| 3624 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3625 | std.debug.assert(rc == 0); |
| 3626 | } |
| 3627 | pub fn faccessat(fd: c_int, path: [*:0]const u8, amode: c_int, flag: c_int) !void { |
| 3628 | const rc = libc.faccessat(fd, path, amode, flag); |
| 3629 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3630 | std.debug.assert(rc == 0); |
| 3631 | } |
| 3632 | pub fn pipe2(flag: c_int) ![2]c_int { |
| 3633 | var fildes: [2]c_int = @splat(-1); |
| 3634 | const rc = libc.pipe2(&fildes, flag); |
| 3635 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3636 | std.debug.assert(rc == 0); |
| 3637 | return fildes; |
| 3638 | } |
| 3639 | pub fn kill(pid: pid_t, sig: c_int) !void { |
| 3640 | const rc = libc.kill(pid, sig); |
| 3641 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3642 | std.debug.assert(rc == 0); |
| 3643 | } |
| 3644 | pub fn fork() !pid_t { |
| 3645 | const rc = libc.fork(); |
| 3646 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3647 | std.debug.assert(rc >= 0); |
| 3648 | return rc; |
| 3649 | } |
| 3650 | pub fn fchdir(fildes: c_int) !void { |
| 3651 | const rc = libc.fchdir(fildes); |
| 3652 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3653 | std.debug.assert(rc == 0); |
| 3654 | } |
| 3655 | pub fn execvp(file: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) !noreturn { |
| 3656 | const rc = libc.execvp(file, argv); |
| 3657 | std.debug.assert(rc == -1); |
| 3658 | return errno.fromInt(errno.fromLibC()); |
| 3659 | } |
| 3660 | pub fn dup2(fildes: c_int, fildes2: c_int) !void { |
| 3661 | const rc = libc.dup2(fildes, fildes2); |
| 3662 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3663 | std.debug.assert(rc >= 0); |
| 3664 | } |
| 3665 | pub fn poll(fds: []struct_pollfd, timeout_ms: c_int) !c_int { |
| 3666 | const rc = libc.poll(fds.ptr, fds.len, timeout_ms); |
| 3667 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3668 | std.debug.assert(rc >= 0); |
| 3669 | return rc; |
| 3670 | } |
| 3671 | pub fn waitpid(pid: pid_t, options: c_int) !struct { pid_t, c_int } { |
| 3672 | var status: c_int = 0; |
| 3673 | const rc = libc.waitpid(pid, &status, options); |
| 3674 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3675 | std.debug.assert(rc >= 0); |
| 3676 | return .{ rc, status }; |
| 3677 | } |
| 3678 | pub fn unlinkat(fd: c_int, name: [*:0]const u8, flag: c_int) !void { |
| 3679 | const rc = libc.unlinkat(fd, name, flag); |
| 3680 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3681 | std.debug.assert(rc == 0); |
| 3682 | } |
| 3683 | pub fn lseek(fd: c_int, offset: off_t, whence: c_int) !void { |
| 3684 | const rc = libc.lseek(fd, offset, whence); |
| 3685 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3686 | std.debug.assert(rc >= 0); |
| 3687 | } |
| 3688 | pub fn getcwd(buf: []u8) ![*:0]u8 { |
| 3689 | const rc = libc.getcwd(buf.ptr, buf.len); |
| 3690 | if (rc == null) return errno.fromInt(errno.fromLibC()); |
| 3691 | return rc.?; |
| 3692 | } |
| 3693 | pub fn fchmod(fd: c_int, mode: mode_t) !void { |
| 3694 | const rc = libc.fchmod(fd, mode); |
| 3695 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3696 | std.debug.assert(rc == 0); |
| 3697 | } |
| 3698 | pub fn copy_file_range(fd_int: c_int, off_in: ?*off_t, fd_out: c_int, off_out: ?*off_t, size: usize, flags: c_uint) errno.Error!usize { |
| 3699 | const rc = libc.copy_file_range(fd_int, off_in, fd_out, off_out, size, flags); |
| 3700 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3701 | std.debug.assert(rc >= 0); |
| 3702 | return @intCast(rc); |
| 3703 | } |
| 3704 | pub fn dup(fildes: c_int) !c_int { |
| 3705 | const rc = libc.dup(fildes); |
| 3706 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3707 | std.debug.assert(rc >= 0); |
| 3708 | return rc; |
| 3709 | } |