1 /* $NetBSD: netbsd32_netbsd.c,v 1.111 2006/09/01 21:20:47 matt Exp $ */ 2 3 /* 4 * Copyright (c) 1998, 2001 Matthew R. Green 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. The name of the author may not be used to endorse or promote products 16 * derived from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 25 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31 #include <sys/cdefs.h> 32 __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.111 2006/09/01 21:20:47 matt Exp $"); 33 34 #if defined(_KERNEL_OPT) 35 #include "opt_ddb.h" 36 #include "opt_ktrace.h" 37 #include "opt_ntp.h" 38 #include "opt_compat_netbsd.h" 39 #include "opt_compat_43.h" 40 #include "opt_sysv.h" 41 #include "opt_nfsserver.h" 42 #include "opt_syscall_debug.h" 43 #include "opt_ptrace.h" 44 45 #include "fs_lfs.h" 46 #include "fs_nfs.h" 47 #endif 48 49 /* 50 * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux, 51 * HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that 52 * this would be LKM-safe. 53 */ 54 #define COMPAT_OLDSOCK /* used by <sys/socket.h> */ 55 56 #include <sys/param.h> 57 #include <sys/systm.h> 58 #include <sys/kernel.h> 59 //#define msg __msg /* Don't ask me! */ 60 #include <sys/malloc.h> 61 #include <sys/mount.h> 62 #include <sys/socket.h> 63 #include <sys/sockio.h> 64 #include <sys/socketvar.h> 65 #include <sys/mbuf.h> 66 #include <sys/stat.h> 67 #include <sys/time.h> 68 #include <sys/signalvar.h> 69 #include <sys/ptrace.h> 70 #include <sys/ktrace.h> 71 #include <sys/trace.h> 72 #include <sys/resourcevar.h> 73 #include <sys/pool.h> 74 #include <sys/vnode.h> 75 #include <sys/file.h> 76 #include <sys/filedesc.h> 77 #include <sys/namei.h> 78 #include <sys/dirent.h> 79 #include <sys/kauth.h> 80 81 #include <uvm/uvm_extern.h> 82 83 #include <sys/sa.h> 84 #include <sys/savar.h> 85 #include <sys/syscallargs.h> 86 #include <sys/proc.h> 87 #include <sys/acct.h> 88 #include <sys/exec.h> 89 90 #include <net/if.h> 91 92 #include <compat/netbsd32/netbsd32.h> 93 #include <compat/netbsd32/netbsd32_exec.h> 94 #include <compat/netbsd32/netbsd32_syscall.h> 95 #include <compat/netbsd32/netbsd32_syscallargs.h> 96 #include <compat/netbsd32/netbsd32_conv.h> 97 #include <compat/netbsd32/netbsd32_sa.h> 98 99 #include <machine/frame.h> 100 101 #if defined(DDB) 102 #include <ddb/ddbvar.h> 103 #endif 104 105 extern struct sysent netbsd32_sysent[]; 106 #ifdef SYSCALL_DEBUG 107 extern const char * const netbsd32_syscallnames[]; 108 #endif 109 #ifdef __HAVE_SYSCALL_INTERN 110 void netbsd32_syscall_intern __P((struct proc *)); 111 #else 112 void syscall __P((void)); 113 #endif 114 115 #ifdef COMPAT_16 116 extern char netbsd32_sigcode[], netbsd32_esigcode[]; 117 struct uvm_object *emul_netbsd32_object; 118 #endif 119 120 extern struct sysctlnode netbsd32_sysctl_root; 121 122 const struct sa_emul saemul_netbsd32 = { 123 sizeof(ucontext32_t), 124 sizeof(struct netbsd32_sa_t), 125 sizeof(netbsd32_sa_tp), 126 netbsd32_sacopyout, 127 netbsd32_upcallconv, 128 netbsd32_cpu_upcall, 129 (void (*)(struct lwp *, void *))getucontext32, 130 netbsd32_sa_ucsp 131 }; 132 133 const struct emul emul_netbsd32 = { 134 "netbsd32", 135 "/emul/netbsd32", 136 #ifndef __HAVE_MINIMAL_EMUL 137 0, 138 NULL, 139 netbsd32_SYS_syscall, 140 netbsd32_SYS_NSYSENT, 141 #endif 142 netbsd32_sysent, 143 #ifdef SYSCALL_DEBUG 144 netbsd32_syscallnames, 145 #else 146 NULL, 147 #endif 148 netbsd32_sendsig, 149 trapsignal, 150 NULL, 151 #ifdef COMPAT_16 152 netbsd32_sigcode, 153 netbsd32_esigcode, 154 &emul_netbsd32_object, 155 #else 156 NULL, 157 NULL, 158 NULL, 159 #endif 160 netbsd32_setregs, 161 NULL, 162 NULL, 163 NULL, 164 NULL, 165 NULL, 166 #ifdef __HAVE_SYSCALL_INTERN 167 netbsd32_syscall_intern, 168 #else 169 syscall, 170 #endif 171 &netbsd32_sysctl_root, 172 NULL, 173 174 netbsd32_vm_default_addr, 175 NULL, 176 &saemul_netbsd32, 177 }; 178 179 /* 180 * below are all the standard NetBSD system calls, in the 32bit 181 * environment, with the necessary conversions to 64bit before 182 * calling the real syscall. anything that needs special 183 * attention is handled elsewhere. 184 */ 185 186 int 187 netbsd32_exit(l, v, retval) 188 struct lwp *l; 189 void *v; 190 register_t *retval; 191 { 192 struct netbsd32_exit_args /* { 193 syscallarg(int) rval; 194 } */ *uap = v; 195 struct sys_exit_args ua; 196 197 NETBSD32TO64_UAP(rval); 198 return sys_exit(l, &ua, retval); 199 } 200 201 int 202 netbsd32_read(l, v, retval) 203 struct lwp *l; 204 void *v; 205 register_t *retval; 206 { 207 struct netbsd32_read_args /* { 208 syscallarg(int) fd; 209 syscallarg(netbsd32_voidp) buf; 210 syscallarg(netbsd32_size_t) nbyte; 211 } */ *uap = v; 212 struct sys_read_args ua; 213 214 NETBSD32TO64_UAP(fd); 215 NETBSD32TOP_UAP(buf, void *); 216 NETBSD32TOX_UAP(nbyte, size_t); 217 return sys_read(l, &ua, retval); 218 } 219 220 int 221 netbsd32_write(l, v, retval) 222 struct lwp *l; 223 void *v; 224 register_t *retval; 225 { 226 struct netbsd32_write_args /* { 227 syscallarg(int) fd; 228 syscallarg(const netbsd32_voidp) buf; 229 syscallarg(netbsd32_size_t) nbyte; 230 } */ *uap = v; 231 struct sys_write_args ua; 232 233 NETBSD32TO64_UAP(fd); 234 NETBSD32TOP_UAP(buf, void *); 235 NETBSD32TOX_UAP(nbyte, size_t); 236 return sys_write(l, &ua, retval); 237 } 238 239 int 240 netbsd32_close(l, v, retval) 241 struct lwp *l; 242 void *v; 243 register_t *retval; 244 { 245 struct netbsd32_close_args /* { 246 syscallarg(int) fd; 247 } */ *uap = v; 248 struct sys_close_args ua; 249 250 NETBSD32TO64_UAP(fd); 251 return sys_close(l, &ua, retval); 252 } 253 254 int 255 netbsd32_open(l, v, retval) 256 struct lwp *l; 257 void *v; 258 register_t *retval; 259 { 260 struct netbsd32_open_args /* { 261 syscallarg(const netbsd32_charp) path; 262 syscallarg(int) flags; 263 syscallarg(mode_t) mode; 264 } */ *uap = v; 265 struct sys_open_args ua; 266 caddr_t sg; 267 268 NETBSD32TOP_UAP(path, const char); 269 NETBSD32TO64_UAP(flags); 270 NETBSD32TO64_UAP(mode); 271 sg = stackgap_init(l->l_proc, 0); 272 CHECK_ALT_EXIST(l, &sg, SCARG(&ua, path)); 273 274 return (sys_open(l, &ua, retval)); 275 } 276 277 int 278 netbsd32_link(l, v, retval) 279 struct lwp *l; 280 void *v; 281 register_t *retval; 282 { 283 struct netbsd32_link_args /* { 284 syscallarg(const netbsd32_charp) path; 285 syscallarg(const netbsd32_charp) link; 286 } */ *uap = v; 287 struct sys_link_args ua; 288 289 NETBSD32TOP_UAP(path, const char); 290 NETBSD32TOP_UAP(link, const char); 291 return (sys_link(l, &ua, retval)); 292 } 293 294 int 295 netbsd32_unlink(l, v, retval) 296 struct lwp *l; 297 void *v; 298 register_t *retval; 299 { 300 struct netbsd32_unlink_args /* { 301 syscallarg(const netbsd32_charp) path; 302 } */ *uap = v; 303 struct sys_unlink_args ua; 304 305 NETBSD32TOP_UAP(path, const char); 306 307 return (sys_unlink(l, &ua, retval)); 308 } 309 310 int 311 netbsd32_chdir(l, v, retval) 312 struct lwp *l; 313 void *v; 314 register_t *retval; 315 { 316 struct netbsd32_chdir_args /* { 317 syscallarg(const netbsd32_charp) path; 318 } */ *uap = v; 319 struct sys_chdir_args ua; 320 321 NETBSD32TOP_UAP(path, const char); 322 323 return (sys_chdir(l, &ua, retval)); 324 } 325 326 int 327 netbsd32_fchdir(l, v, retval) 328 struct lwp *l; 329 void *v; 330 register_t *retval; 331 { 332 struct netbsd32_fchdir_args /* { 333 syscallarg(int) fd; 334 } */ *uap = v; 335 struct sys_fchdir_args ua; 336 337 NETBSD32TO64_UAP(fd); 338 339 return (sys_fchdir(l, &ua, retval)); 340 } 341 342 int 343 netbsd32_mknod(l, v, retval) 344 struct lwp *l; 345 void *v; 346 register_t *retval; 347 { 348 struct netbsd32_mknod_args /* { 349 syscallarg(const netbsd32_charp) path; 350 syscallarg(mode_t) mode; 351 syscallarg(dev_t) dev; 352 } */ *uap = v; 353 struct sys_mknod_args ua; 354 355 NETBSD32TOP_UAP(path, const char); 356 NETBSD32TO64_UAP(dev); 357 NETBSD32TO64_UAP(mode); 358 359 return (sys_mknod(l, &ua, retval)); 360 } 361 362 int 363 netbsd32_chmod(l, v, retval) 364 struct lwp *l; 365 void *v; 366 register_t *retval; 367 { 368 struct netbsd32_chmod_args /* { 369 syscallarg(const netbsd32_charp) path; 370 syscallarg(mode_t) mode; 371 } */ *uap = v; 372 struct sys_chmod_args ua; 373 374 NETBSD32TOP_UAP(path, const char); 375 NETBSD32TO64_UAP(mode); 376 377 return (sys_chmod(l, &ua, retval)); 378 } 379 380 int 381 netbsd32_chown(l, v, retval) 382 struct lwp *l; 383 void *v; 384 register_t *retval; 385 { 386 struct netbsd32_chown_args /* { 387 syscallarg(const netbsd32_charp) path; 388 syscallarg(uid_t) uid; 389 syscallarg(gid_t) gid; 390 } */ *uap = v; 391 struct sys_chown_args ua; 392 393 NETBSD32TOP_UAP(path, const char); 394 NETBSD32TO64_UAP(uid); 395 NETBSD32TO64_UAP(gid); 396 397 return (sys_chown(l, &ua, retval)); 398 } 399 400 int 401 netbsd32_break(l, v, retval) 402 struct lwp *l; 403 void *v; 404 register_t *retval; 405 { 406 struct netbsd32_break_args /* { 407 syscallarg(netbsd32_charp) nsize; 408 } */ *uap = v; 409 struct sys_obreak_args ua; 410 411 SCARG(&ua, nsize) = (char *)NETBSD32PTR64(SCARG(uap, nsize)); 412 NETBSD32TOP_UAP(nsize, char); 413 return (sys_obreak(l, &ua, retval)); 414 } 415 416 int 417 netbsd32_mount(l, v, retval) 418 struct lwp *l; 419 void *v; 420 register_t *retval; 421 { 422 struct netbsd32_mount_args /* { 423 syscallarg(const netbsd32_charp) type; 424 syscallarg(const netbsd32_charp) path; 425 syscallarg(int) flags; 426 syscallarg(netbsd32_voidp) data; 427 } */ *uap = v; 428 struct sys_mount_args ua; 429 430 NETBSD32TOP_UAP(type, const char); 431 NETBSD32TOP_UAP(path, const char); 432 NETBSD32TO64_UAP(flags); 433 NETBSD32TOP_UAP(data, void); 434 return (sys_mount(l, &ua, retval)); 435 } 436 437 int 438 netbsd32_unmount(l, v, retval) 439 struct lwp *l; 440 void *v; 441 register_t *retval; 442 { 443 struct netbsd32_unmount_args /* { 444 syscallarg(const netbsd32_charp) path; 445 syscallarg(int) flags; 446 } */ *uap = v; 447 struct sys_unmount_args ua; 448 449 NETBSD32TOP_UAP(path, const char); 450 NETBSD32TO64_UAP(flags); 451 return (sys_unmount(l, &ua, retval)); 452 } 453 454 int 455 netbsd32_setuid(l, v, retval) 456 struct lwp *l; 457 void *v; 458 register_t *retval; 459 { 460 struct netbsd32_setuid_args /* { 461 syscallarg(uid_t) uid; 462 } */ *uap = v; 463 struct sys_setuid_args ua; 464 465 NETBSD32TO64_UAP(uid); 466 return (sys_setuid(l, &ua, retval)); 467 } 468 469 int 470 netbsd32_ptrace(l, v, retval) 471 struct lwp *l; 472 void *v; 473 register_t *retval; 474 { 475 #if defined(PTRACE) || defined(_LKM) 476 struct netbsd32_ptrace_args /* { 477 syscallarg(int) req; 478 syscallarg(pid_t) pid; 479 syscallarg(netbsd32_caddr_t) addr; 480 syscallarg(int) data; 481 } */ *uap = v; 482 struct sys_ptrace_args ua; 483 484 NETBSD32TO64_UAP(req); 485 NETBSD32TO64_UAP(pid); 486 NETBSD32TOX64_UAP(addr, caddr_t); 487 NETBSD32TO64_UAP(data); 488 #ifdef _LKM 489 return (*sysent[SYS_ptrace].sy_call)(l, &ua, retval); 490 #else 491 return sys_ptrace(l, &ua, retval); 492 #endif 493 #else 494 return (ENOSYS); 495 #endif /* PTRACE || _LKM */ 496 } 497 498 int 499 netbsd32_accept(l, v, retval) 500 struct lwp *l; 501 void *v; 502 register_t *retval; 503 { 504 struct netbsd32_accept_args /* { 505 syscallarg(int) s; 506 syscallarg(netbsd32_sockaddrp_t) name; 507 syscallarg(netbsd32_intp) anamelen; 508 } */ *uap = v; 509 struct sys_accept_args ua; 510 511 NETBSD32TO64_UAP(s); 512 NETBSD32TOP_UAP(name, struct sockaddr); 513 NETBSD32TOP_UAP(anamelen, socklen_t); 514 return (sys_accept(l, &ua, retval)); 515 } 516 517 int 518 netbsd32_getpeername(l, v, retval) 519 struct lwp *l; 520 void *v; 521 register_t *retval; 522 { 523 struct netbsd32_getpeername_args /* { 524 syscallarg(int) fdes; 525 syscallarg(netbsd32_sockaddrp_t) asa; 526 syscallarg(netbsd32_intp) alen; 527 } */ *uap = v; 528 struct sys_getpeername_args ua; 529 530 NETBSD32TO64_UAP(fdes); 531 NETBSD32TOP_UAP(asa, struct sockaddr); 532 NETBSD32TOP_UAP(alen, socklen_t); 533 /* NB: do the protocol specific sockaddrs need to be converted? */ 534 return (sys_getpeername(l, &ua, retval)); 535 } 536 537 int 538 netbsd32_getsockname(l, v, retval) 539 struct lwp *l; 540 void *v; 541 register_t *retval; 542 { 543 struct netbsd32_getsockname_args /* { 544 syscallarg(int) fdes; 545 syscallarg(netbsd32_sockaddrp_t) asa; 546 syscallarg(netbsd32_intp) alen; 547 } */ *uap = v; 548 struct sys_getsockname_args ua; 549 550 NETBSD32TO64_UAP(fdes); 551 NETBSD32TOP_UAP(asa, struct sockaddr); 552 NETBSD32TOP_UAP(alen, socklen_t); 553 return (sys_getsockname(l, &ua, retval)); 554 } 555 556 int 557 netbsd32_access(l, v, retval) 558 struct lwp *l; 559 void *v; 560 register_t *retval; 561 { 562 struct netbsd32_access_args /* { 563 syscallarg(const netbsd32_charp) path; 564 syscallarg(int) flags; 565 } */ *uap = v; 566 struct sys_access_args ua; 567 caddr_t sg; 568 569 NETBSD32TOP_UAP(path, const char); 570 NETBSD32TO64_UAP(flags); 571 sg = stackgap_init(l->l_proc, 0); 572 CHECK_ALT_EXIST(l, &sg, SCARG(&ua, path)); 573 574 return (sys_access(l, &ua, retval)); 575 } 576 577 int 578 netbsd32_chflags(l, v, retval) 579 struct lwp *l; 580 void *v; 581 register_t *retval; 582 { 583 struct netbsd32_chflags_args /* { 584 syscallarg(const netbsd32_charp) path; 585 syscallarg(netbsd32_u_long) flags; 586 } */ *uap = v; 587 struct sys_chflags_args ua; 588 589 NETBSD32TOP_UAP(path, const char); 590 NETBSD32TO64_UAP(flags); 591 592 return (sys_chflags(l, &ua, retval)); 593 } 594 595 int 596 netbsd32_fchflags(l, v, retval) 597 struct lwp *l; 598 void *v; 599 register_t *retval; 600 { 601 struct netbsd32_fchflags_args /* { 602 syscallarg(int) fd; 603 syscallarg(netbsd32_u_long) flags; 604 } */ *uap = v; 605 struct sys_fchflags_args ua; 606 607 NETBSD32TO64_UAP(fd); 608 NETBSD32TO64_UAP(flags); 609 610 return (sys_fchflags(l, &ua, retval)); 611 } 612 613 int 614 netbsd32_lchflags(l, v, retval) 615 struct lwp *l; 616 void *v; 617 register_t *retval; 618 { 619 struct netbsd32_lchflags_args /* { 620 syscallarg(const char *) path; 621 syscallarg(netbsd32_u_long) flags; 622 } */ *uap = v; 623 struct sys_lchflags_args ua; 624 625 NETBSD32TOP_UAP(path, const char); 626 NETBSD32TO64_UAP(flags); 627 628 return (sys_lchflags(l, &ua, retval)); 629 } 630 631 int 632 netbsd32_kill(l, v, retval) 633 struct lwp *l; 634 void *v; 635 register_t *retval; 636 { 637 struct netbsd32_kill_args /* { 638 syscallarg(int) pid; 639 syscallarg(int) signum; 640 } */ *uap = v; 641 struct sys_kill_args ua; 642 643 NETBSD32TO64_UAP(pid); 644 NETBSD32TO64_UAP(signum); 645 646 return (sys_kill(l, &ua, retval)); 647 } 648 649 int 650 netbsd32_dup(l, v, retval) 651 struct lwp *l; 652 void *v; 653 register_t *retval; 654 { 655 struct netbsd32_dup_args /* { 656 syscallarg(int) fd; 657 } */ *uap = v; 658 struct sys_dup_args ua; 659 660 NETBSD32TO64_UAP(fd); 661 662 return (sys_dup(l, &ua, retval)); 663 } 664 665 int 666 netbsd32_profil(l, v, retval) 667 struct lwp *l; 668 void *v; 669 register_t *retval; 670 { 671 struct netbsd32_profil_args /* { 672 syscallarg(netbsd32_caddr_t) samples; 673 syscallarg(netbsd32_size_t) size; 674 syscallarg(netbsd32_u_long) offset; 675 syscallarg(u_int) scale; 676 } */ *uap = v; 677 struct sys_profil_args ua; 678 679 NETBSD32TOX64_UAP(samples, caddr_t); 680 NETBSD32TOX_UAP(size, size_t); 681 NETBSD32TOX_UAP(offset, u_long); 682 NETBSD32TO64_UAP(scale); 683 return (sys_profil(l, &ua, retval)); 684 } 685 686 #ifdef KTRACE 687 int 688 netbsd32_ktrace(l, v, retval) 689 struct lwp *l; 690 void *v; 691 register_t *retval; 692 { 693 struct netbsd32_ktrace_args /* { 694 syscallarg(const netbsd32_charp) fname; 695 syscallarg(int) ops; 696 syscallarg(int) facs; 697 syscallarg(int) pid; 698 } */ *uap = v; 699 struct sys_ktrace_args ua; 700 701 NETBSD32TOP_UAP(fname, const char); 702 NETBSD32TO64_UAP(ops); 703 NETBSD32TO64_UAP(facs); 704 NETBSD32TO64_UAP(pid); 705 return (sys_ktrace(l, &ua, retval)); 706 } 707 #endif /* KTRACE */ 708 709 int 710 netbsd32_utrace(l, v, retval) 711 struct lwp *l; 712 void *v; 713 register_t *retval; 714 { 715 struct netbsd32_utrace_args /* { 716 syscallarg(const netbsd32_charp) label; 717 syscallarg(netbsd32_voidp) addr; 718 syscallarg(netbsd32_size_t) len; 719 } */ *uap = v; 720 struct sys_utrace_args ua; 721 722 NETBSD32TOP_UAP(label, const char); 723 NETBSD32TOP_UAP(addr, void); 724 NETBSD32TO64_UAP(len); 725 return (sys_utrace(l, &ua, retval)); 726 } 727 728 int 729 netbsd32___getlogin(l, v, retval) 730 struct lwp *l; 731 void *v; 732 register_t *retval; 733 { 734 struct netbsd32___getlogin_args /* { 735 syscallarg(netbsd32_charp) namebuf; 736 syscallarg(u_int) namelen; 737 } */ *uap = v; 738 struct sys___getlogin_args ua; 739 740 NETBSD32TOP_UAP(namebuf, char); 741 NETBSD32TO64_UAP(namelen); 742 return (sys___getlogin(l, &ua, retval)); 743 } 744 745 int 746 netbsd32_setlogin(l, v, retval) 747 struct lwp *l; 748 void *v; 749 register_t *retval; 750 { 751 struct netbsd32_setlogin_args /* { 752 syscallarg(const netbsd32_charp) namebuf; 753 } */ *uap = v; 754 struct sys___setlogin_args ua; 755 756 NETBSD32TOP_UAP(namebuf, char); 757 return (sys___setlogin(l, &ua, retval)); 758 } 759 760 int 761 netbsd32_acct(l, v, retval) 762 struct lwp *l; 763 void *v; 764 register_t *retval; 765 { 766 struct netbsd32_acct_args /* { 767 syscallarg(const netbsd32_charp) path; 768 } */ *uap = v; 769 struct sys_acct_args ua; 770 771 NETBSD32TOP_UAP(path, const char); 772 return (sys_acct(l, &ua, retval)); 773 } 774 775 int 776 netbsd32_revoke(l, v, retval) 777 struct lwp *l; 778 void *v; 779 register_t *retval; 780 { 781 struct netbsd32_revoke_args /* { 782 syscallarg(const netbsd32_charp) path; 783 } */ *uap = v; 784 struct sys_revoke_args ua; 785 caddr_t sg; 786 787 NETBSD32TOP_UAP(path, const char); 788 sg = stackgap_init(l->l_proc, 0); 789 CHECK_ALT_EXIST(l, &sg, SCARG(&ua, path)); 790 791 return (sys_revoke(l, &ua, retval)); 792 } 793 794 int 795 netbsd32_symlink(l, v, retval) 796 struct lwp *l; 797 void *v; 798 register_t *retval; 799 { 800 struct netbsd32_symlink_args /* { 801 syscallarg(const netbsd32_charp) path; 802 syscallarg(const netbsd32_charp) link; 803 } */ *uap = v; 804 struct sys_symlink_args ua; 805 806 NETBSD32TOP_UAP(path, const char); 807 NETBSD32TOP_UAP(link, const char); 808 809 return (sys_symlink(l, &ua, retval)); 810 } 811 812 int 813 netbsd32_readlink(l, v, retval) 814 struct lwp *l; 815 void *v; 816 register_t *retval; 817 { 818 struct netbsd32_readlink_args /* { 819 syscallarg(const netbsd32_charp) path; 820 syscallarg(netbsd32_charp) buf; 821 syscallarg(netbsd32_size_t) count; 822 } */ *uap = v; 823 struct sys_readlink_args ua; 824 caddr_t sg; 825 826 NETBSD32TOP_UAP(path, const char); 827 NETBSD32TOP_UAP(buf, char); 828 NETBSD32TOX_UAP(count, size_t); 829 sg = stackgap_init(l->l_proc, 0); 830 CHECK_ALT_SYMLINK(l, &sg, SCARG(&ua, path)); 831 832 return (sys_readlink(l, &ua, retval)); 833 } 834 835 int 836 netbsd32_umask(l, v, retval) 837 struct lwp *l; 838 void *v; 839 register_t *retval; 840 { 841 struct netbsd32_umask_args /* { 842 syscallarg(mode_t) newmask; 843 } */ *uap = v; 844 struct sys_umask_args ua; 845 846 NETBSD32TO64_UAP(newmask); 847 return (sys_umask(l, &ua, retval)); 848 } 849 850 int 851 netbsd32_chroot(l, v, retval) 852 struct lwp *l; 853 void *v; 854 register_t *retval; 855 { 856 struct netbsd32_chroot_args /* { 857 syscallarg(const netbsd32_charp) path; 858 } */ *uap = v; 859 struct sys_chroot_args ua; 860 861 NETBSD32TOP_UAP(path, const char); 862 return (sys_chroot(l, &ua, retval)); 863 } 864 865 int 866 netbsd32_sbrk(l, v, retval) 867 struct lwp *l; 868 void *v; 869 register_t *retval; 870 { 871 struct netbsd32_sbrk_args /* { 872 syscallarg(int) incr; 873 } */ *uap = v; 874 struct sys_sbrk_args ua; 875 876 NETBSD32TO64_UAP(incr); 877 return (sys_sbrk(l, &ua, retval)); 878 } 879 880 int 881 netbsd32_sstk(l, v, retval) 882 struct lwp *l; 883 void *v; 884 register_t *retval; 885 { 886 struct netbsd32_sstk_args /* { 887 syscallarg(int) incr; 888 } */ *uap = v; 889 struct sys_sstk_args ua; 890 891 NETBSD32TO64_UAP(incr); 892 return (sys_sstk(l, &ua, retval)); 893 } 894 895 int 896 netbsd32_munmap(l, v, retval) 897 struct lwp *l; 898 void *v; 899 register_t *retval; 900 { 901 struct netbsd32_munmap_args /* { 902 syscallarg(netbsd32_voidp) addr; 903 syscallarg(netbsd32_size_t) len; 904 } */ *uap = v; 905 struct sys_munmap_args ua; 906 907 NETBSD32TOP_UAP(addr, void); 908 NETBSD32TOX_UAP(len, size_t); 909 return (sys_munmap(l, &ua, retval)); 910 } 911 912 int 913 netbsd32_mprotect(l, v, retval) 914 struct lwp *l; 915 void *v; 916 register_t *retval; 917 { 918 struct netbsd32_mprotect_args /* { 919 syscallarg(netbsd32_voidp) addr; 920 syscallarg(netbsd32_size_t) len; 921 syscallarg(int) prot; 922 } */ *uap = v; 923 struct sys_mprotect_args ua; 924 925 NETBSD32TOP_UAP(addr, void); 926 NETBSD32TOX_UAP(len, size_t); 927 NETBSD32TO64_UAP(prot); 928 return (sys_mprotect(l, &ua, retval)); 929 } 930 931 int 932 netbsd32_madvise(l, v, retval) 933 struct lwp *l; 934 void *v; 935 register_t *retval; 936 { 937 struct netbsd32_madvise_args /* { 938 syscallarg(netbsd32_voidp) addr; 939 syscallarg(netbsd32_size_t) len; 940 syscallarg(int) behav; 941 } */ *uap = v; 942 struct sys_madvise_args ua; 943 944 NETBSD32TOP_UAP(addr, void); 945 NETBSD32TOX_UAP(len, size_t); 946 NETBSD32TO64_UAP(behav); 947 return (sys_madvise(l, &ua, retval)); 948 } 949 950 int 951 netbsd32_mincore(l, v, retval) 952 struct lwp *l; 953 void *v; 954 register_t *retval; 955 { 956 struct netbsd32_mincore_args /* { 957 syscallarg(netbsd32_caddr_t) addr; 958 syscallarg(netbsd32_size_t) len; 959 syscallarg(netbsd32_charp) vec; 960 } */ *uap = v; 961 struct sys_mincore_args ua; 962 963 NETBSD32TOX64_UAP(addr, caddr_t); 964 NETBSD32TOX_UAP(len, size_t); 965 NETBSD32TOP_UAP(vec, char); 966 return (sys_mincore(l, &ua, retval)); 967 } 968 969 /* XXX MOVE ME XXX ? */ 970 int 971 netbsd32_getgroups(l, v, retval) 972 struct lwp *l; 973 void *v; 974 register_t *retval; 975 { 976 struct netbsd32_getgroups_args /* { 977 syscallarg(int) gidsetsize; 978 syscallarg(netbsd32_gid_tp) gidset; 979 } */ *uap = v; 980 kauth_cred_t pc = l->l_cred; 981 int ngrp; 982 int error; 983 gid_t *grbuf; 984 985 ngrp = SCARG(uap, gidsetsize); 986 if (ngrp == 0) { 987 *retval = kauth_cred_ngroups(pc); 988 return (0); 989 } 990 if (ngrp < kauth_cred_ngroups(pc)) 991 return (EINVAL); 992 ngrp = kauth_cred_ngroups(pc); 993 /* Should convert gid_t to netbsd32_gid_t, but they're the same */ 994 grbuf = malloc(ngrp * sizeof(*grbuf), M_TEMP, M_WAITOK); 995 kauth_cred_getgroups(pc, grbuf, ngrp); 996 error = copyout(grbuf, (caddr_t)NETBSD32PTR64(SCARG(uap, gidset)), 997 ngrp * sizeof(*grbuf)); 998 free(grbuf, M_TEMP); 999 if (error) 1000 return (error); 1001 *retval = ngrp; 1002 return (0); 1003 } 1004 1005 int 1006 netbsd32_setgroups(l, v, retval) 1007 struct lwp *l; 1008 void *v; 1009 register_t *retval; 1010 { 1011 struct netbsd32_setgroups_args /* { 1012 syscallarg(int) gidsetsize; 1013 syscallarg(const netbsd32_gid_tp) gidset; 1014 } */ *uap = v; 1015 struct sys_setgroups_args ua; 1016 1017 NETBSD32TO64_UAP(gidsetsize); 1018 NETBSD32TOP_UAP(gidset, gid_t); 1019 return (sys_setgroups(l, &ua, retval)); 1020 } 1021 1022 int 1023 netbsd32_setpgid(l, v, retval) 1024 struct lwp *l; 1025 void *v; 1026 register_t *retval; 1027 { 1028 struct netbsd32_setpgid_args /* { 1029 syscallarg(int) pid; 1030 syscallarg(int) pgid; 1031 } */ *uap = v; 1032 struct sys_setpgid_args ua; 1033 1034 NETBSD32TO64_UAP(pid); 1035 NETBSD32TO64_UAP(pgid); 1036 return (sys_setpgid(l, &ua, retval)); 1037 } 1038 1039 int 1040 netbsd32_fcntl(l, v, retval) 1041 struct lwp *l; 1042 void *v; 1043 register_t *retval; 1044 { 1045 struct netbsd32_fcntl_args /* { 1046 syscallarg(int) fd; 1047 syscallarg(int) cmd; 1048 syscallarg(netbsd32_voidp) arg; 1049 } */ *uap = v; 1050 struct sys_fcntl_args ua; 1051 1052 NETBSD32TO64_UAP(fd); 1053 NETBSD32TO64_UAP(cmd); 1054 NETBSD32TOP_UAP(arg, void); 1055 /* we can do this because `struct flock' doesn't change */ 1056 return (sys_fcntl(l, &ua, retval)); 1057 } 1058 1059 int 1060 netbsd32_dup2(l, v, retval) 1061 struct lwp *l; 1062 void *v; 1063 register_t *retval; 1064 { 1065 struct netbsd32_dup2_args /* { 1066 syscallarg(int) from; 1067 syscallarg(int) to; 1068 } */ *uap = v; 1069 struct sys_dup2_args ua; 1070 1071 NETBSD32TO64_UAP(from); 1072 NETBSD32TO64_UAP(to); 1073 return (sys_dup2(l, &ua, retval)); 1074 } 1075 1076 int 1077 netbsd32_fsync(l, v, retval) 1078 struct lwp *l; 1079 void *v; 1080 register_t *retval; 1081 { 1082 struct netbsd32_fsync_args /* { 1083 syscallarg(int) fd; 1084 } */ *uap = v; 1085 struct sys_fsync_args ua; 1086 1087 NETBSD32TO64_UAP(fd); 1088 return (sys_fsync(l, &ua, retval)); 1089 } 1090 1091 int 1092 netbsd32_setpriority(l, v, retval) 1093 struct lwp *l; 1094 void *v; 1095 register_t *retval; 1096 { 1097 struct netbsd32_setpriority_args /* { 1098 syscallarg(int) which; 1099 syscallarg(int) who; 1100 syscallarg(int) prio; 1101 } */ *uap = v; 1102 struct sys_setpriority_args ua; 1103 1104 NETBSD32TO64_UAP(which); 1105 NETBSD32TO64_UAP(who); 1106 NETBSD32TO64_UAP(prio); 1107 return (sys_setpriority(l, &ua, retval)); 1108 } 1109 1110 int 1111 netbsd32_sys___socket30(l, v, retval) 1112 struct lwp *l; 1113 void *v; 1114 register_t *retval; 1115 { 1116 struct netbsd32_sys___socket30_args /* { 1117 syscallarg(int) domain; 1118 syscallarg(int) type; 1119 syscallarg(int) protocol; 1120 } */ *uap = v; 1121 struct sys___socket30_args ua; 1122 1123 NETBSD32TO64_UAP(domain); 1124 NETBSD32TO64_UAP(type); 1125 NETBSD32TO64_UAP(protocol); 1126 return (sys___socket30(l, &ua, retval)); 1127 } 1128 1129 int 1130 netbsd32_connect(l, v, retval) 1131 struct lwp *l; 1132 void *v; 1133 register_t *retval; 1134 { 1135 struct netbsd32_connect_args /* { 1136 syscallarg(int) s; 1137 syscallarg(const netbsd32_sockaddrp_t) name; 1138 syscallarg(int) namelen; 1139 } */ *uap = v; 1140 struct sys_connect_args ua; 1141 1142 NETBSD32TO64_UAP(s); 1143 NETBSD32TOP_UAP(name, struct sockaddr); 1144 NETBSD32TO64_UAP(namelen); 1145 return (sys_connect(l, &ua, retval)); 1146 } 1147 1148 int 1149 netbsd32_getpriority(l, v, retval) 1150 struct lwp *l; 1151 void *v; 1152 register_t *retval; 1153 { 1154 struct netbsd32_getpriority_args /* { 1155 syscallarg(int) which; 1156 syscallarg(int) who; 1157 } */ *uap = v; 1158 struct sys_getpriority_args ua; 1159 1160 NETBSD32TO64_UAP(which); 1161 NETBSD32TO64_UAP(who); 1162 return (sys_getpriority(l, &ua, retval)); 1163 } 1164 1165 int 1166 netbsd32_bind(l, v, retval) 1167 struct lwp *l; 1168 void *v; 1169 register_t *retval; 1170 { 1171 struct netbsd32_bind_args /* { 1172 syscallarg(int) s; 1173 syscallarg(const netbsd32_sockaddrp_t) name; 1174 syscallarg(int) namelen; 1175 } */ *uap = v; 1176 struct sys_bind_args ua; 1177 1178 NETBSD32TO64_UAP(s); 1179 NETBSD32TOP_UAP(name, struct sockaddr); 1180 NETBSD32TO64_UAP(namelen); 1181 return (sys_bind(l, &ua, retval)); 1182 } 1183 1184 int 1185 netbsd32_setsockopt(l, v, retval) 1186 struct lwp *l; 1187 void *v; 1188 register_t *retval; 1189 { 1190 struct netbsd32_setsockopt_args /* { 1191 syscallarg(int) s; 1192 syscallarg(int) level; 1193 syscallarg(int) name; 1194 syscallarg(const netbsd32_voidp) val; 1195 syscallarg(int) valsize; 1196 } */ *uap = v; 1197 struct sys_setsockopt_args ua; 1198 1199 NETBSD32TO64_UAP(s); 1200 NETBSD32TO64_UAP(level); 1201 NETBSD32TO64_UAP(name); 1202 NETBSD32TOP_UAP(val, void); 1203 NETBSD32TO64_UAP(valsize); 1204 /* may be more efficient to do this inline. */ 1205 return (sys_setsockopt(l, &ua, retval)); 1206 } 1207 1208 int 1209 netbsd32_listen(l, v, retval) 1210 struct lwp *l; 1211 void *v; 1212 register_t *retval; 1213 { 1214 struct netbsd32_listen_args /* { 1215 syscallarg(int) s; 1216 syscallarg(int) backlog; 1217 } */ *uap = v; 1218 struct sys_listen_args ua; 1219 1220 NETBSD32TO64_UAP(s); 1221 NETBSD32TO64_UAP(backlog); 1222 return (sys_listen(l, &ua, retval)); 1223 } 1224 1225 int 1226 netbsd32_fchown(l, v, retval) 1227 struct lwp *l; 1228 void *v; 1229 register_t *retval; 1230 { 1231 struct netbsd32_fchown_args /* { 1232 syscallarg(int) fd; 1233 syscallarg(uid_t) uid; 1234 syscallarg(gid_t) gid; 1235 } */ *uap = v; 1236 struct sys_fchown_args ua; 1237 1238 NETBSD32TO64_UAP(fd); 1239 NETBSD32TO64_UAP(uid); 1240 NETBSD32TO64_UAP(gid); 1241 return (sys_fchown(l, &ua, retval)); 1242 } 1243 1244 int 1245 netbsd32_fchmod(l, v, retval) 1246 struct lwp *l; 1247 void *v; 1248 register_t *retval; 1249 { 1250 struct netbsd32_fchmod_args /* { 1251 syscallarg(int) fd; 1252 syscallarg(mode_t) mode; 1253 } */ *uap = v; 1254 struct sys_fchmod_args ua; 1255 1256 NETBSD32TO64_UAP(fd); 1257 NETBSD32TO64_UAP(mode); 1258 return (sys_fchmod(l, &ua, retval)); 1259 } 1260 1261 int 1262 netbsd32_setreuid(l, v, retval) 1263 struct lwp *l; 1264 void *v; 1265 register_t *retval; 1266 { 1267 struct netbsd32_setreuid_args /* { 1268 syscallarg(uid_t) ruid; 1269 syscallarg(uid_t) euid; 1270 } */ *uap = v; 1271 struct sys_setreuid_args ua; 1272 1273 NETBSD32TO64_UAP(ruid); 1274 NETBSD32TO64_UAP(euid); 1275 return (sys_setreuid(l, &ua, retval)); 1276 } 1277 1278 int 1279 netbsd32_setregid(l, v, retval) 1280 struct lwp *l; 1281 void *v; 1282 register_t *retval; 1283 { 1284 struct netbsd32_setregid_args /* { 1285 syscallarg(gid_t) rgid; 1286 syscallarg(gid_t) egid; 1287 } */ *uap = v; 1288 struct sys_setregid_args ua; 1289 1290 NETBSD32TO64_UAP(rgid); 1291 NETBSD32TO64_UAP(egid); 1292 return (sys_setregid(l, &ua, retval)); 1293 } 1294 1295 int 1296 netbsd32_getsockopt(l, v, retval) 1297 struct lwp *l; 1298 void *v; 1299 register_t *retval; 1300 { 1301 struct netbsd32_getsockopt_args /* { 1302 syscallarg(int) s; 1303 syscallarg(int) level; 1304 syscallarg(int) name; 1305 syscallarg(netbsd32_voidp) val; 1306 syscallarg(netbsd32_intp) avalsize; 1307 } */ *uap = v; 1308 struct sys_getsockopt_args ua; 1309 1310 NETBSD32TO64_UAP(s); 1311 NETBSD32TO64_UAP(level); 1312 NETBSD32TO64_UAP(name); 1313 NETBSD32TOP_UAP(val, void); 1314 NETBSD32TOP_UAP(avalsize, socklen_t); 1315 return (sys_getsockopt(l, &ua, retval)); 1316 } 1317 1318 int 1319 netbsd32_rename(l, v, retval) 1320 struct lwp *l; 1321 void *v; 1322 register_t *retval; 1323 { 1324 struct netbsd32_rename_args /* { 1325 syscallarg(const netbsd32_charp) from; 1326 syscallarg(const netbsd32_charp) to; 1327 } */ *uap = v; 1328 struct sys_rename_args ua; 1329 1330 NETBSD32TOP_UAP(from, const char); 1331 NETBSD32TOP_UAP(to, const char) 1332 1333 return (sys_rename(l, &ua, retval)); 1334 } 1335 1336 int 1337 netbsd32_flock(l, v, retval) 1338 struct lwp *l; 1339 void *v; 1340 register_t *retval; 1341 { 1342 struct netbsd32_flock_args /* { 1343 syscallarg(int) fd; 1344 syscallarg(int) how; 1345 } */ *uap = v; 1346 struct sys_flock_args ua; 1347 1348 NETBSD32TO64_UAP(fd); 1349 NETBSD32TO64_UAP(how) 1350 1351 return (sys_flock(l, &ua, retval)); 1352 } 1353 1354 int 1355 netbsd32_mkfifo(l, v, retval) 1356 struct lwp *l; 1357 void *v; 1358 register_t *retval; 1359 { 1360 struct netbsd32_mkfifo_args /* { 1361 syscallarg(const netbsd32_charp) path; 1362 syscallarg(mode_t) mode; 1363 } */ *uap = v; 1364 struct sys_mkfifo_args ua; 1365 1366 NETBSD32TOP_UAP(path, const char) 1367 NETBSD32TO64_UAP(mode); 1368 return (sys_mkfifo(l, &ua, retval)); 1369 } 1370 1371 int 1372 netbsd32_shutdown(l, v, retval) 1373 struct lwp *l; 1374 void *v; 1375 register_t *retval; 1376 { 1377 struct netbsd32_shutdown_args /* { 1378 syscallarg(int) s; 1379 syscallarg(int) how; 1380 } */ *uap = v; 1381 struct sys_shutdown_args ua; 1382 1383 NETBSD32TO64_UAP(s) 1384 NETBSD32TO64_UAP(how); 1385 return (sys_shutdown(l, &ua, retval)); 1386 } 1387 1388 int 1389 netbsd32_socketpair(l, v, retval) 1390 struct lwp *l; 1391 void *v; 1392 register_t *retval; 1393 { 1394 struct netbsd32_socketpair_args /* { 1395 syscallarg(int) domain; 1396 syscallarg(int) type; 1397 syscallarg(int) protocol; 1398 syscallarg(netbsd32_intp) rsv; 1399 } */ *uap = v; 1400 struct sys_socketpair_args ua; 1401 1402 NETBSD32TO64_UAP(domain); 1403 NETBSD32TO64_UAP(type); 1404 NETBSD32TO64_UAP(protocol); 1405 NETBSD32TOP_UAP(rsv, int); 1406 /* Since we're just copying out two `int's we can do this */ 1407 return (sys_socketpair(l, &ua, retval)); 1408 } 1409 1410 int 1411 netbsd32_mkdir(l, v, retval) 1412 struct lwp *l; 1413 void *v; 1414 register_t *retval; 1415 { 1416 struct netbsd32_mkdir_args /* { 1417 syscallarg(const netbsd32_charp) path; 1418 syscallarg(mode_t) mode; 1419 } */ *uap = v; 1420 struct sys_mkdir_args ua; 1421 1422 NETBSD32TOP_UAP(path, const char) 1423 NETBSD32TO64_UAP(mode); 1424 return (sys_mkdir(l, &ua, retval)); 1425 } 1426 1427 int 1428 netbsd32_rmdir(l, v, retval) 1429 struct lwp *l; 1430 void *v; 1431 register_t *retval; 1432 { 1433 struct netbsd32_rmdir_args /* { 1434 syscallarg(const netbsd32_charp) path; 1435 } */ *uap = v; 1436 struct sys_rmdir_args ua; 1437 1438 NETBSD32TOP_UAP(path, const char); 1439 return (sys_rmdir(l, &ua, retval)); 1440 } 1441 1442 int 1443 netbsd32_quotactl(l, v, retval) 1444 struct lwp *l; 1445 void *v; 1446 register_t *retval; 1447 { 1448 struct netbsd32_quotactl_args /* { 1449 syscallarg(const netbsd32_charp) path; 1450 syscallarg(int) cmd; 1451 syscallarg(int) uid; 1452 syscallarg(netbsd32_caddr_t) arg; 1453 } */ *uap = v; 1454 struct sys_quotactl_args ua; 1455 1456 NETBSD32TOP_UAP(path, const char); 1457 NETBSD32TO64_UAP(cmd); 1458 NETBSD32TO64_UAP(uid); 1459 NETBSD32TOX64_UAP(arg, caddr_t); 1460 return (sys_quotactl(l, &ua, retval)); 1461 } 1462 1463 #if defined(NFS) || defined(NFSSERVER) 1464 int 1465 netbsd32_nfssvc(l, v, retval) 1466 struct lwp *l; 1467 void *v; 1468 register_t *retval; 1469 { 1470 #if 0 1471 struct netbsd32_nfssvc_args /* { 1472 syscallarg(int) flag; 1473 syscallarg(netbsd32_voidp) argp; 1474 } */ *uap = v; 1475 struct sys_nfssvc_args ua; 1476 1477 NETBSD32TO64_UAP(flag); 1478 NETBSD32TOP_UAP(argp, void); 1479 return (sys_nfssvc(l, &ua, retval)); 1480 #else 1481 /* Why would we want to support a 32-bit nfsd? */ 1482 return (ENOSYS); 1483 #endif 1484 } 1485 #endif 1486 1487 int 1488 netbsd32___getfh30(l, v, retval) 1489 struct lwp *l; 1490 void *v; 1491 register_t *retval; 1492 { 1493 struct netbsd32___getfh30_args /* { 1494 syscallarg(const netbsd32_charp) fname; 1495 syscallarg(netbsd32_fhandlep_t) fhp; 1496 syscallarg(netbsd32_size_tp) fh_size; 1497 } */ *uap = v; 1498 struct vnode *vp; 1499 fhandle_t *fh; 1500 int error; 1501 struct nameidata nd; 1502 netbsd32_size_t sz32; 1503 size_t sz; 1504 1505 /* 1506 * Must be super user 1507 */ 1508 error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER, 1509 &l->l_acflag); 1510 if (error) 1511 return (error); 1512 fh = NULL; 1513 NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, 1514 (char *)NETBSD32PTR64(SCARG(uap, fname)), l); 1515 error = namei(&nd); 1516 if (error) 1517 return (error); 1518 vp = nd.ni_vp; 1519 error = copyin(NETBSD32PTR64(SCARG(uap, fh_size)), &sz32, 1520 sizeof(netbsd32_size_t)); 1521 if (!error) { 1522 fh = malloc(sz32, M_TEMP, M_WAITOK); 1523 if (fh == NULL) 1524 return EINVAL; 1525 sz = sz32; 1526 error = vfs_composefh(vp, fh, &sz); 1527 sz32 = sz; 1528 } 1529 vput(vp); 1530 if (error == E2BIG) 1531 copyout(&sz, NETBSD32PTR64(SCARG(uap, fh_size)), sizeof(size_t)); 1532 if (error == 0) { 1533 error = copyout(&sz32, NETBSD32PTR64(SCARG(uap, fh_size)), 1534 sizeof(netbsd32_size_t)); 1535 if (!error) 1536 error = copyout(fh, NETBSD32PTR64(SCARG(uap, fhp)), sz); 1537 } 1538 free(fh, M_TEMP); 1539 return (error); 1540 } 1541 1542 int 1543 netbsd32_pread(l, v, retval) 1544 struct lwp *l; 1545 void *v; 1546 register_t *retval; 1547 { 1548 struct netbsd32_pread_args /* { 1549 syscallarg(int) fd; 1550 syscallarg(netbsd32_voidp) buf; 1551 syscallarg(netbsd32_size_t) nbyte; 1552 syscallarg(int) pad; 1553 syscallarg(off_t) offset; 1554 } */ *uap = v; 1555 struct sys_pread_args ua; 1556 ssize_t rt; 1557 int error; 1558 1559 NETBSD32TO64_UAP(fd); 1560 NETBSD32TOP_UAP(buf, void); 1561 NETBSD32TOX_UAP(nbyte, size_t); 1562 NETBSD32TO64_UAP(pad); 1563 NETBSD32TO64_UAP(offset); 1564 error = sys_pread(l, &ua, (register_t *)&rt); 1565 *retval = rt; 1566 return (error); 1567 } 1568 1569 int 1570 netbsd32_pwrite(l, v, retval) 1571 struct lwp *l; 1572 void *v; 1573 register_t *retval; 1574 { 1575 struct netbsd32_pwrite_args /* { 1576 syscallarg(int) fd; 1577 syscallarg(const netbsd32_voidp) buf; 1578 syscallarg(netbsd32_size_t) nbyte; 1579 syscallarg(int) pad; 1580 syscallarg(off_t) offset; 1581 } */ *uap = v; 1582 struct sys_pwrite_args ua; 1583 ssize_t rt; 1584 int error; 1585 1586 NETBSD32TO64_UAP(fd); 1587 NETBSD32TOP_UAP(buf, void); 1588 NETBSD32TOX_UAP(nbyte, size_t); 1589 NETBSD32TO64_UAP(pad); 1590 NETBSD32TO64_UAP(offset); 1591 error = sys_pwrite(l, &ua, (register_t *)&rt); 1592 *retval = rt; 1593 return (error); 1594 } 1595 1596 int 1597 netbsd32_setgid(l, v, retval) 1598 struct lwp *l; 1599 void *v; 1600 register_t *retval; 1601 { 1602 struct netbsd32_setgid_args /* { 1603 syscallarg(gid_t) gid; 1604 } */ *uap = v; 1605 struct sys_setgid_args ua; 1606 1607 NETBSD32TO64_UAP(gid); 1608 return (sys_setgid(l, v, retval)); 1609 } 1610 1611 int 1612 netbsd32_setegid(l, v, retval) 1613 struct lwp *l; 1614 void *v; 1615 register_t *retval; 1616 { 1617 struct netbsd32_setegid_args /* { 1618 syscallarg(gid_t) egid; 1619 } */ *uap = v; 1620 struct sys_setegid_args ua; 1621 1622 NETBSD32TO64_UAP(egid); 1623 return (sys_setegid(l, v, retval)); 1624 } 1625 1626 int 1627 netbsd32_seteuid(l, v, retval) 1628 struct lwp *l; 1629 void *v; 1630 register_t *retval; 1631 { 1632 struct netbsd32_seteuid_args /* { 1633 syscallarg(gid_t) euid; 1634 } */ *uap = v; 1635 struct sys_seteuid_args ua; 1636 1637 NETBSD32TO64_UAP(euid); 1638 return (sys_seteuid(l, v, retval)); 1639 } 1640 1641 #ifdef LFS 1642 int 1643 netbsd32_sys_lfs_bmapv(l, v, retval) 1644 struct lwp *l; 1645 void *v; 1646 register_t *retval; 1647 { 1648 1649 return (ENOSYS); /* XXX */ 1650 } 1651 1652 int 1653 netbsd32_sys_lfs_markv(l, v, retval) 1654 struct lwp *l; 1655 void *v; 1656 register_t *retval; 1657 { 1658 1659 return (ENOSYS); /* XXX */ 1660 } 1661 1662 int 1663 netbsd32_sys_lfs_segclean(l, v, retval) 1664 struct lwp *l; 1665 void *v; 1666 register_t *retval; 1667 { 1668 1669 return (ENOSYS); /* XXX */ 1670 } 1671 1672 int 1673 netbsd32_sys_lfs_segwait(l, v, retval) 1674 struct lwp *l; 1675 void *v; 1676 register_t *retval; 1677 { 1678 1679 return (ENOSYS); /* XXX */ 1680 } 1681 #endif 1682 1683 int 1684 netbsd32_pathconf(l, v, retval) 1685 struct lwp *l; 1686 void *v; 1687 register_t *retval; 1688 { 1689 struct netbsd32_pathconf_args /* { 1690 syscallarg(int) fd; 1691 syscallarg(int) name; 1692 } */ *uap = v; 1693 struct sys_pathconf_args ua; 1694 long rt; 1695 int error; 1696 1697 NETBSD32TOP_UAP(path, const char); 1698 NETBSD32TO64_UAP(name); 1699 error = sys_pathconf(l, &ua, (register_t *)&rt); 1700 *retval = rt; 1701 return (error); 1702 } 1703 1704 int 1705 netbsd32_fpathconf(l, v, retval) 1706 struct lwp *l; 1707 void *v; 1708 register_t *retval; 1709 { 1710 struct netbsd32_fpathconf_args /* { 1711 syscallarg(int) fd; 1712 syscallarg(int) name; 1713 } */ *uap = v; 1714 struct sys_fpathconf_args ua; 1715 long rt; 1716 int error; 1717 1718 NETBSD32TO64_UAP(fd); 1719 NETBSD32TO64_UAP(name); 1720 error = sys_fpathconf(l, &ua, (register_t *)&rt); 1721 *retval = rt; 1722 return (error); 1723 } 1724 1725 int 1726 netbsd32_getrlimit(l, v, retval) 1727 struct lwp *l; 1728 void *v; 1729 register_t *retval; 1730 { 1731 struct netbsd32_getrlimit_args /* { 1732 syscallarg(int) which; 1733 syscallarg(netbsd32_rlimitp_t) rlp; 1734 } */ *uap = v; 1735 int which = SCARG(uap, which); 1736 1737 if ((u_int)which >= RLIM_NLIMITS) 1738 return (EINVAL); 1739 return (copyout(&l->l_proc->p_rlimit[which], 1740 (caddr_t)NETBSD32PTR64(SCARG(uap, rlp)), sizeof(struct rlimit))); 1741 } 1742 1743 int 1744 netbsd32_setrlimit(l, v, retval) 1745 struct lwp *l; 1746 void *v; 1747 register_t *retval; 1748 { 1749 struct netbsd32_setrlimit_args /* { 1750 syscallarg(int) which; 1751 syscallarg(const netbsd32_rlimitp_t) rlp; 1752 } */ *uap = v; 1753 int which = SCARG(uap, which); 1754 struct rlimit alim; 1755 int error; 1756 1757 error = copyin((caddr_t)NETBSD32PTR64(SCARG(uap, rlp)), &alim, 1758 sizeof(struct rlimit)); 1759 if (error) 1760 return (error); 1761 1762 switch (which) { 1763 case RLIMIT_DATA: 1764 if (alim.rlim_cur > MAXDSIZ32) 1765 alim.rlim_cur = MAXDSIZ32; 1766 if (alim.rlim_max > MAXDSIZ32) 1767 alim.rlim_max = MAXDSIZ32; 1768 break; 1769 1770 case RLIMIT_STACK: 1771 if (alim.rlim_cur > MAXSSIZ32) 1772 alim.rlim_cur = MAXSSIZ32; 1773 if (alim.rlim_max > MAXSSIZ32) 1774 alim.rlim_max = MAXSSIZ32; 1775 default: 1776 break; 1777 } 1778 1779 return (dosetrlimit(l, l->l_proc, which, &alim)); 1780 } 1781 1782 int 1783 netbsd32_mmap(l, v, retval) 1784 struct lwp *l; 1785 void *v; 1786 register_t *retval; 1787 { 1788 struct netbsd32_mmap_args /* { 1789 syscallarg(netbsd32_voidp) addr; 1790 syscallarg(netbsd32_size_t) len; 1791 syscallarg(int) prot; 1792 syscallarg(int) flags; 1793 syscallarg(int) fd; 1794 syscallarg(netbsd32_long) pad; 1795 syscallarg(off_t) pos; 1796 } */ *uap = v; 1797 struct sys_mmap_args ua; 1798 int error; 1799 1800 NETBSD32TOP_UAP(addr, void); 1801 NETBSD32TOX_UAP(len, size_t); 1802 NETBSD32TO64_UAP(prot); 1803 NETBSD32TO64_UAP(flags); 1804 NETBSD32TO64_UAP(fd); 1805 NETBSD32TOX_UAP(pad, long); 1806 NETBSD32TOX_UAP(pos, off_t); 1807 error = sys_mmap(l, &ua, retval); 1808 if ((u_long)*retval > (u_long)UINT_MAX) { 1809 printf("netbsd32_mmap: retval out of range: 0x%lx", 1810 (u_long)*retval); 1811 /* Should try to recover and return an error here. */ 1812 } 1813 return (error); 1814 } 1815 1816 int 1817 netbsd32_lseek(l, v, retval) 1818 struct lwp *l; 1819 void *v; 1820 register_t *retval; 1821 { 1822 struct netbsd32_lseek_args /* { 1823 syscallarg(int) fd; 1824 syscallarg(int) pad; 1825 syscallarg(off_t) offset; 1826 syscallarg(int) whence; 1827 } */ *uap = v; 1828 struct sys_lseek_args ua; 1829 int rv; 1830 1831 NETBSD32TO64_UAP(fd); 1832 NETBSD32TO64_UAP(pad); 1833 NETBSD32TO64_UAP(offset); 1834 NETBSD32TO64_UAP(whence); 1835 rv = sys_lseek(l, &ua, retval); 1836 #ifdef NETBSD32_OFF_T_RETURN 1837 if (rv == 0) 1838 NETBSD32_OFF_T_RETURN(retval); 1839 #endif 1840 return rv; 1841 } 1842 1843 int 1844 netbsd32_truncate(l, v, retval) 1845 struct lwp *l; 1846 void *v; 1847 register_t *retval; 1848 { 1849 struct netbsd32_truncate_args /* { 1850 syscallarg(const netbsd32_charp) path; 1851 syscallarg(int) pad; 1852 syscallarg(off_t) length; 1853 } */ *uap = v; 1854 struct sys_truncate_args ua; 1855 1856 NETBSD32TOP_UAP(path, const char); 1857 NETBSD32TO64_UAP(pad); 1858 NETBSD32TO64_UAP(length); 1859 return (sys_truncate(l, &ua, retval)); 1860 } 1861 1862 int 1863 netbsd32_ftruncate(l, v, retval) 1864 struct lwp *l; 1865 void *v; 1866 register_t *retval; 1867 { 1868 struct netbsd32_ftruncate_args /* { 1869 syscallarg(int) fd; 1870 syscallarg(int) pad; 1871 syscallarg(off_t) length; 1872 } */ *uap = v; 1873 struct sys_ftruncate_args ua; 1874 1875 NETBSD32TO64_UAP(fd); 1876 NETBSD32TO64_UAP(pad); 1877 NETBSD32TO64_UAP(length); 1878 return (sys_ftruncate(l, &ua, retval)); 1879 } 1880 1881 int 1882 netbsd32_mlock(l, v, retval) 1883 struct lwp *l; 1884 void *v; 1885 register_t *retval; 1886 { 1887 struct netbsd32_mlock_args /* { 1888 syscallarg(const netbsd32_voidp) addr; 1889 syscallarg(netbsd32_size_t) len; 1890 } */ *uap = v; 1891 struct sys_mlock_args ua; 1892 1893 NETBSD32TOP_UAP(addr, const void); 1894 NETBSD32TO64_UAP(len); 1895 return (sys_mlock(l, &ua, retval)); 1896 } 1897 1898 int 1899 netbsd32_munlock(l, v, retval) 1900 struct lwp *l; 1901 void *v; 1902 register_t *retval; 1903 { 1904 struct netbsd32_munlock_args /* { 1905 syscallarg(const netbsd32_voidp) addr; 1906 syscallarg(netbsd32_size_t) len; 1907 } */ *uap = v; 1908 struct sys_munlock_args ua; 1909 1910 NETBSD32TOP_UAP(addr, const void); 1911 NETBSD32TO64_UAP(len); 1912 return (sys_munlock(l, &ua, retval)); 1913 } 1914 1915 int 1916 netbsd32_undelete(l, v, retval) 1917 struct lwp *l; 1918 void *v; 1919 register_t *retval; 1920 { 1921 struct netbsd32_undelete_args /* { 1922 syscallarg(const netbsd32_charp) path; 1923 } */ *uap = v; 1924 struct sys_undelete_args ua; 1925 1926 NETBSD32TOP_UAP(path, const char); 1927 return (sys_undelete(l, &ua, retval)); 1928 } 1929 1930 int 1931 netbsd32_getpgid(l, v, retval) 1932 struct lwp *l; 1933 void *v; 1934 register_t *retval; 1935 { 1936 struct netbsd32_getpgid_args /* { 1937 syscallarg(pid_t) pid; 1938 } */ *uap = v; 1939 struct sys_getpgid_args ua; 1940 1941 NETBSD32TO64_UAP(pid); 1942 return (sys_getpgid(l, &ua, retval)); 1943 } 1944 1945 int 1946 netbsd32_reboot(l, v, retval) 1947 struct lwp *l; 1948 void *v; 1949 register_t *retval; 1950 { 1951 struct netbsd32_reboot_args /* { 1952 syscallarg(int) opt; 1953 syscallarg(netbsd32_charp) bootstr; 1954 } */ *uap = v; 1955 struct sys_reboot_args ua; 1956 1957 NETBSD32TO64_UAP(opt); 1958 NETBSD32TOP_UAP(bootstr, char); 1959 return (sys_reboot(l, &ua, retval)); 1960 } 1961 1962 #include <sys/poll.h> 1963 int 1964 netbsd32_poll(l, v, retval) 1965 struct lwp *l; 1966 void *v; 1967 register_t *retval; 1968 { 1969 struct netbsd32_poll_args /* { 1970 syscallarg(netbsd32_pollfdp_t) fds; 1971 syscallarg(u_int) nfds; 1972 syscallarg(int) timeout; 1973 } */ *uap = v; 1974 struct sys_poll_args ua; 1975 1976 NETBSD32TOP_UAP(fds, struct pollfd); 1977 NETBSD32TO64_UAP(nfds); 1978 NETBSD32TO64_UAP(timeout); 1979 1980 return (sys_poll(l, &ua, retval)); 1981 } 1982 1983 int 1984 netbsd32_fdatasync(l, v, retval) 1985 struct lwp *l; 1986 void *v; 1987 register_t *retval; 1988 { 1989 struct netbsd32_fdatasync_args /* { 1990 syscallarg(int) fd; 1991 } */ *uap = v; 1992 struct sys_fdatasync_args ua; 1993 1994 NETBSD32TO64_UAP(fd); 1995 return (sys_fdatasync(l, &ua, retval)); 1996 } 1997 1998 int 1999 netbsd32___posix_rename(l, v, retval) 2000 struct lwp *l; 2001 void *v; 2002 register_t *retval; 2003 { 2004 struct netbsd32___posix_rename_args /* { 2005 syscallarg(const netbsd32_charp) from; 2006 syscallarg(const netbsd32_charp) to; 2007 } */ *uap = v; 2008 struct sys___posix_rename_args ua; 2009 2010 NETBSD32TOP_UAP(from, const char); 2011 NETBSD32TOP_UAP(to, const char); 2012 return (sys___posix_rename(l, &ua, retval)); 2013 } 2014 2015 int 2016 netbsd32_swapctl(l, v, retval) 2017 struct lwp *l; 2018 void *v; 2019 register_t *retval; 2020 { 2021 struct netbsd32_swapctl_args /* { 2022 syscallarg(int) cmd; 2023 syscallarg(const netbsd32_voidp) arg; 2024 syscallarg(int) misc; 2025 } */ *uap = v; 2026 struct sys_swapctl_args ua; 2027 2028 NETBSD32TO64_UAP(cmd); 2029 NETBSD32TOP_UAP(arg, void); 2030 NETBSD32TO64_UAP(misc); 2031 return (sys_swapctl(l, &ua, retval)); 2032 } 2033 2034 int 2035 netbsd32_minherit(l, v, retval) 2036 struct lwp *l; 2037 void *v; 2038 register_t *retval; 2039 { 2040 struct netbsd32_minherit_args /* { 2041 syscallarg(netbsd32_voidp) addr; 2042 syscallarg(netbsd32_size_t) len; 2043 syscallarg(int) inherit; 2044 } */ *uap = v; 2045 struct sys_minherit_args ua; 2046 2047 NETBSD32TOP_UAP(addr, void); 2048 NETBSD32TOX_UAP(len, size_t); 2049 NETBSD32TO64_UAP(inherit); 2050 return (sys_minherit(l, &ua, retval)); 2051 } 2052 2053 int 2054 netbsd32_lchmod(l, v, retval) 2055 struct lwp *l; 2056 void *v; 2057 register_t *retval; 2058 { 2059 struct netbsd32_lchmod_args /* { 2060 syscallarg(const netbsd32_charp) path; 2061 syscallarg(mode_t) mode; 2062 } */ *uap = v; 2063 struct sys_lchmod_args ua; 2064 2065 NETBSD32TOP_UAP(path, const char); 2066 NETBSD32TO64_UAP(mode); 2067 return (sys_lchmod(l, &ua, retval)); 2068 } 2069 2070 int 2071 netbsd32_lchown(l, v, retval) 2072 struct lwp *l; 2073 void *v; 2074 register_t *retval; 2075 { 2076 struct netbsd32_lchown_args /* { 2077 syscallarg(const netbsd32_charp) path; 2078 syscallarg(uid_t) uid; 2079 syscallarg(gid_t) gid; 2080 } */ *uap = v; 2081 struct sys_lchown_args ua; 2082 2083 NETBSD32TOP_UAP(path, const char); 2084 NETBSD32TO64_UAP(uid); 2085 NETBSD32TO64_UAP(gid); 2086 return (sys_lchown(l, &ua, retval)); 2087 } 2088 2089 int 2090 netbsd32___msync13(l, v, retval) 2091 struct lwp *l; 2092 void *v; 2093 register_t *retval; 2094 { 2095 struct netbsd32___msync13_args /* { 2096 syscallarg(netbsd32_voidp) addr; 2097 syscallarg(netbsd32_size_t) len; 2098 syscallarg(int) flags; 2099 } */ *uap = v; 2100 struct sys___msync13_args ua; 2101 2102 NETBSD32TOP_UAP(addr, void); 2103 NETBSD32TOX_UAP(len, size_t); 2104 NETBSD32TO64_UAP(flags); 2105 return (sys___msync13(l, &ua, retval)); 2106 } 2107 2108 int 2109 netbsd32___posix_chown(l, v, retval) 2110 struct lwp *l; 2111 void *v; 2112 register_t *retval; 2113 { 2114 struct netbsd32___posix_chown_args /* { 2115 syscallarg(const netbsd32_charp) path; 2116 syscallarg(uid_t) uid; 2117 syscallarg(gid_t) gid; 2118 } */ *uap = v; 2119 struct sys___posix_chown_args ua; 2120 2121 NETBSD32TOP_UAP(path, const char); 2122 NETBSD32TO64_UAP(uid); 2123 NETBSD32TO64_UAP(gid); 2124 return (sys___posix_chown(l, &ua, retval)); 2125 } 2126 2127 int 2128 netbsd32___posix_fchown(l, v, retval) 2129 struct lwp *l; 2130 void *v; 2131 register_t *retval; 2132 { 2133 struct netbsd32___posix_fchown_args /* { 2134 syscallarg(int) fd; 2135 syscallarg(uid_t) uid; 2136 syscallarg(gid_t) gid; 2137 } */ *uap = v; 2138 struct sys___posix_fchown_args ua; 2139 2140 NETBSD32TO64_UAP(fd); 2141 NETBSD32TO64_UAP(uid); 2142 NETBSD32TO64_UAP(gid); 2143 return (sys___posix_fchown(l, &ua, retval)); 2144 } 2145 2146 int 2147 netbsd32___posix_lchown(l, v, retval) 2148 struct lwp *l; 2149 void *v; 2150 register_t *retval; 2151 { 2152 struct netbsd32___posix_lchown_args /* { 2153 syscallarg(const netbsd32_charp) path; 2154 syscallarg(uid_t) uid; 2155 syscallarg(gid_t) gid; 2156 } */ *uap = v; 2157 struct sys___posix_lchown_args ua; 2158 2159 NETBSD32TOP_UAP(path, const char); 2160 NETBSD32TO64_UAP(uid); 2161 NETBSD32TO64_UAP(gid); 2162 return (sys___posix_lchown(l, &ua, retval)); 2163 } 2164 2165 int 2166 netbsd32_getsid(l, v, retval) 2167 struct lwp *l; 2168 void *v; 2169 register_t *retval; 2170 { 2171 struct netbsd32_getsid_args /* { 2172 syscallarg(pid_t) pid; 2173 } */ *uap = v; 2174 struct sys_getsid_args ua; 2175 2176 NETBSD32TO64_UAP(pid); 2177 return (sys_getsid(l, &ua, retval)); 2178 } 2179 2180 #ifdef KTRACE 2181 int 2182 netbsd32_fktrace(l, v, retval) 2183 struct lwp *l; 2184 void *v; 2185 register_t *retval; 2186 { 2187 struct netbsd32_fktrace_args /* { 2188 syscallarg(const int) fd; 2189 syscallarg(int) ops; 2190 syscallarg(int) facs; 2191 syscallarg(int) pid; 2192 } */ *uap = v; 2193 #if 0 2194 struct sys_fktrace_args ua; 2195 #else 2196 /* XXXX */ 2197 struct sys_fktrace_noconst_args { 2198 syscallarg(int) fd; 2199 syscallarg(int) ops; 2200 syscallarg(int) facs; 2201 syscallarg(int) pid; 2202 } ua; 2203 #endif 2204 2205 NETBSD32TOX_UAP(fd, int); 2206 NETBSD32TO64_UAP(ops); 2207 NETBSD32TO64_UAP(facs); 2208 NETBSD32TO64_UAP(pid); 2209 return (sys_fktrace(l, &ua, retval)); 2210 } 2211 #endif /* KTRACE */ 2212 2213 int netbsd32___sigpending14(l, v, retval) 2214 struct lwp *l; 2215 void *v; 2216 register_t *retval; 2217 { 2218 struct netbsd32___sigpending14_args /* { 2219 syscallarg(sigset_t *) set; 2220 } */ *uap = v; 2221 struct sys___sigpending14_args ua; 2222 2223 NETBSD32TOP_UAP(set, sigset_t); 2224 return (sys___sigpending14(l, &ua, retval)); 2225 } 2226 2227 int netbsd32___sigprocmask14(l, v, retval) 2228 struct lwp *l; 2229 void *v; 2230 register_t *retval; 2231 { 2232 struct netbsd32___sigprocmask14_args /* { 2233 syscallarg(int) how; 2234 syscallarg(const sigset_t *) set; 2235 syscallarg(sigset_t *) oset; 2236 } */ *uap = v; 2237 struct sys___sigprocmask14_args ua; 2238 2239 NETBSD32TO64_UAP(how); 2240 NETBSD32TOP_UAP(set, sigset_t); 2241 NETBSD32TOP_UAP(oset, sigset_t); 2242 return (sys___sigprocmask14(l, &ua, retval)); 2243 } 2244 2245 int netbsd32___sigsuspend14(l, v, retval) 2246 struct lwp *l; 2247 void *v; 2248 register_t *retval; 2249 { 2250 struct netbsd32___sigsuspend14_args /* { 2251 syscallarg(const sigset_t *) set; 2252 } */ *uap = v; 2253 struct sys___sigsuspend14_args ua; 2254 2255 NETBSD32TOP_UAP(set, sigset_t); 2256 return (sys___sigsuspend14(l, &ua, retval)); 2257 }; 2258 2259 int netbsd32_fchroot(l, v, retval) 2260 struct lwp *l; 2261 void *v; 2262 register_t *retval; 2263 { 2264 struct netbsd32_fchroot_args /* { 2265 syscallarg(int) fd; 2266 } */ *uap = v; 2267 struct sys_fchroot_args ua; 2268 2269 NETBSD32TO64_UAP(fd); 2270 return (sys_fchroot(l, &ua, retval)); 2271 } 2272 2273 /* 2274 * Open a file given a file handle. 2275 * 2276 * Check permissions, allocate an open file structure, 2277 * and call the device open routine if any. 2278 */ 2279 int 2280 netbsd32___fhopen40(l, v, retval) 2281 struct lwp *l; 2282 void *v; 2283 register_t *retval; 2284 { 2285 struct netbsd32___fhopen40_args /* { 2286 syscallarg(const netbsd32_pointer_t *) fhp; 2287 syscallarg(netbsd32_size_t) fh_size; 2288 syscallarg(int) flags; 2289 } */ *uap = v; 2290 struct sys___fhopen40_args ua; 2291 2292 NETBSD32TOP_UAP(fhp, fhandle_t); 2293 NETBSD32TO64_UAP(fh_size); 2294 NETBSD32TO64_UAP(flags); 2295 return (sys___fhopen40(l, &ua, retval)); 2296 } 2297 2298 /* virtual memory syscalls */ 2299 int 2300 netbsd32_ovadvise(l, v, retval) 2301 struct lwp *l; 2302 void *v; 2303 register_t *retval; 2304 { 2305 struct netbsd32_ovadvise_args /* { 2306 syscallarg(int) anom; 2307 } */ *uap = v; 2308 struct sys_ovadvise_args ua; 2309 2310 NETBSD32TO64_UAP(anom); 2311 return (sys_ovadvise(l, &ua, retval)); 2312 } 2313 2314 void 2315 netbsd32_adjust_limits(struct proc *p) 2316 { 2317 rlim_t *valp; 2318 2319 valp = &p->p_rlimit[RLIMIT_DATA].rlim_cur; 2320 if (*valp != RLIM_INFINITY && *valp > MAXDSIZ32) 2321 *valp = MAXDSIZ32; 2322 valp = &p->p_rlimit[RLIMIT_DATA].rlim_max; 2323 if (*valp != RLIM_INFINITY && *valp > MAXDSIZ32) 2324 *valp = MAXDSIZ32; 2325 2326 valp = &p->p_rlimit[RLIMIT_STACK].rlim_cur; 2327 if (*valp != RLIM_INFINITY && *valp > MAXSSIZ32) 2328 *valp = MAXSSIZ32; 2329 valp = &p->p_rlimit[RLIMIT_STACK].rlim_max; 2330 if (*valp != RLIM_INFINITY && *valp > MAXSSIZ32) 2331 *valp = MAXSSIZ32; 2332 } 2333 2334 int 2335 netbsd32_uuidgen(struct lwp *l, void *v, register_t *retval) 2336 { 2337 struct netbsd32_uuidgen_args /* { 2338 syscallarg(netbsd32_uuidp_t) store; 2339 syscallarg(int) count; 2340 } */ *uap = v; 2341 struct sys_uuidgen_args ua; 2342 2343 NETBSD32TOP_UAP(store, struct uuid); 2344 NETBSD32TO64_UAP(count); 2345 return (sys_uuidgen(l, &ua, retval)); 2346 } 2347 2348 int 2349 netbsd32_extattrctl(struct lwp *l, void *v, register_t *retval) 2350 { 2351 struct netbsd32_extattrctl_args /* { 2352 syscallarg(const netbsd32_charp) path; 2353 syscallarg(int) cmd; 2354 syscallarg(const netbsd32_charp) filename; 2355 syscallarg(int) attrnamespace; 2356 syscallarg(const netbsd32_charp) attrname; 2357 } */ *uap = v; 2358 struct sys_extattrctl_args ua; 2359 2360 NETBSD32TOP_UAP(path, const char); 2361 NETBSD32TO64_UAP(cmd); 2362 NETBSD32TOP_UAP(filename, const char); 2363 NETBSD32TO64_UAP(attrnamespace); 2364 NETBSD32TOP_UAP(attrname, const char); 2365 return sys_extattrctl(l, &ua, retval); 2366 } 2367 2368 int 2369 netbsd32_extattr_set_fd(struct lwp *l, void *v, register_t *retval) 2370 { 2371 struct netbsd32_extattr_set_fd_args /* { 2372 syscallarg(int) fd; 2373 syscallarg(int) attrnamespace; 2374 syscallarg(const netbsd32_charp) attrname; 2375 syscallarg(const netbsd32_voidp) data; 2376 syscallarg(netbsd32_size_t) nbytes; 2377 } */ *uap = v; 2378 struct sys_extattr_set_fd_args ua; 2379 2380 NETBSD32TO64_UAP(fd); 2381 NETBSD32TO64_UAP(attrnamespace); 2382 NETBSD32TOP_UAP(attrname, const char); 2383 NETBSD32TOP_UAP(data, const void); 2384 NETBSD32TOX_UAP(nbytes, size_t); 2385 return sys_extattr_set_fd(l, &ua, retval); 2386 } 2387 2388 int 2389 netbsd32_extattr_set_file(struct lwp *l, void *v, register_t *retval) 2390 { 2391 struct netbsd32_extattr_set_file_args /* { 2392 syscallarg(const netbsd32_charp) path; 2393 syscallarg(int) attrnamespace; 2394 syscallarg(const netbsd32_charp) attrname; 2395 syscallarg(const netbsd32_voidp) data; 2396 syscallarg(netbsd32_size_t) nbytes; 2397 } */ *uap = v; 2398 struct sys_extattr_set_file_args ua; 2399 2400 NETBSD32TOP_UAP(path, const char); 2401 NETBSD32TO64_UAP(attrnamespace); 2402 NETBSD32TOP_UAP(attrname, const char); 2403 NETBSD32TOP_UAP(data, const void); 2404 NETBSD32TOX_UAP(nbytes, size_t); 2405 return sys_extattr_set_file(l, &ua, retval); 2406 } 2407 2408 int 2409 netbsd32_extattr_set_link(struct lwp *l, void *v, register_t *retval) 2410 { 2411 struct netbsd32_extattr_set_link_args /* { 2412 syscallarg(const netbsd32_charp) path; 2413 syscallarg(int) attrnamespace; 2414 syscallarg(const netbsd32_charp) attrname; 2415 syscallarg(const netbsd32_voidp) data; 2416 syscallarg(netbsd32_size_t) nbytes; 2417 } */ *uap = v; 2418 struct sys_extattr_set_link_args ua; 2419 2420 NETBSD32TOP_UAP(path, const char); 2421 NETBSD32TO64_UAP(attrnamespace); 2422 NETBSD32TOP_UAP(attrname, const char); 2423 NETBSD32TOP_UAP(data, const void); 2424 NETBSD32TOX_UAP(nbytes, size_t); 2425 return sys_extattr_set_link(l, &ua, retval); 2426 } 2427 2428 int 2429 netbsd32_extattr_get_fd(struct lwp *l, void *v, register_t *retval) 2430 { 2431 struct netbsd32_extattr_get_fd_args /* { 2432 syscallarg(int) fd; 2433 syscallarg(int) attrnamespace; 2434 syscallarg(const netbsd32_charp) attrname; 2435 syscallarg(netbsd32_voidp) data; 2436 syscallarg(netbsd32_size_t) nbytes; 2437 } */ *uap = v; 2438 struct sys_extattr_get_fd_args ua; 2439 2440 NETBSD32TO64_UAP(fd); 2441 NETBSD32TO64_UAP(attrnamespace); 2442 NETBSD32TOP_UAP(attrname, const char); 2443 NETBSD32TOP_UAP(data, void); 2444 NETBSD32TOX_UAP(nbytes, size_t); 2445 return sys_extattr_get_fd(l, &ua, retval); 2446 } 2447 2448 int 2449 netbsd32_extattr_get_file(struct lwp *l, void *v, register_t *retval) 2450 { 2451 struct netbsd32_extattr_get_file_args /* { 2452 syscallarg(const netbsd32_charp) path; 2453 syscallarg(int) attrnamespace; 2454 syscallarg(const netbsd32_charp) attrname; 2455 syscallarg(netbsd32_voidp) data; 2456 syscallarg(netbsd32_size_t) nbytes; 2457 } */ *uap = v; 2458 struct sys_extattr_get_file_args ua; 2459 2460 NETBSD32TOP_UAP(path, const char); 2461 NETBSD32TO64_UAP(attrnamespace); 2462 NETBSD32TOP_UAP(attrname, const char); 2463 NETBSD32TOP_UAP(data, void); 2464 NETBSD32TOX_UAP(nbytes, size_t); 2465 return sys_extattr_get_file(l, &ua, retval); 2466 } 2467 2468 int 2469 netbsd32_extattr_get_link(struct lwp *l, void *v, register_t *retval) 2470 { 2471 struct netbsd32_extattr_get_link_args /* { 2472 syscallarg(const netbsd32_charp) path; 2473 syscallarg(int) attrnamespace; 2474 syscallarg(const netbsd32_charp) attrname; 2475 syscallarg(netbsd32_voidp) data; 2476 syscallarg(netbsd32_size_t) nbytes; 2477 } */ *uap = v; 2478 struct sys_extattr_get_link_args ua; 2479 2480 NETBSD32TOP_UAP(path, const char); 2481 NETBSD32TO64_UAP(attrnamespace); 2482 NETBSD32TOP_UAP(attrname, const char); 2483 NETBSD32TOP_UAP(data, void); 2484 NETBSD32TOX_UAP(nbytes, size_t); 2485 return sys_extattr_get_link(l, &ua, retval); 2486 } 2487 2488 int 2489 netbsd32_extattr_delete_fd(struct lwp *l, void *v, register_t *retval) 2490 { 2491 struct netbsd32_extattr_delete_fd_args /* { 2492 syscallarg(int) fd; 2493 syscallarg(int) attrnamespace; 2494 syscallarg(const netbsd32_charp) attrname; 2495 } */ *uap = v; 2496 struct sys_extattr_delete_fd_args ua; 2497 2498 NETBSD32TO64_UAP(fd); 2499 NETBSD32TO64_UAP(attrnamespace); 2500 NETBSD32TOP_UAP(attrname, const char); 2501 return sys_extattr_delete_fd(l, &ua, retval); 2502 } 2503 2504 int 2505 netbsd32_extattr_delete_file(struct lwp *l, void *v, register_t *retval) 2506 { 2507 struct netbsd32_extattr_delete_file_args /* { 2508 syscallarg(const netbsd32_charp) path; 2509 syscallarg(int) attrnamespace; 2510 syscallarg(const netbsd32_charp) attrname; 2511 } */ *uap = v; 2512 struct sys_extattr_delete_file_args ua; 2513 2514 NETBSD32TOP_UAP(path, const char); 2515 NETBSD32TO64_UAP(attrnamespace); 2516 NETBSD32TOP_UAP(attrname, const char); 2517 return sys_extattr_delete_file(l, &ua, retval); 2518 } 2519 2520 int 2521 netbsd32_extattr_delete_link(struct lwp *l, void *v, register_t *retval) 2522 { 2523 struct netbsd32_extattr_delete_link_args /* { 2524 syscallarg(const netbsd32_charp) path; 2525 syscallarg(int) attrnamespace; 2526 syscallarg(const netbsd32_charp) attrname; 2527 } */ *uap = v; 2528 struct sys_extattr_delete_link_args ua; 2529 2530 NETBSD32TOP_UAP(path, const char); 2531 NETBSD32TO64_UAP(attrnamespace); 2532 NETBSD32TOP_UAP(attrname, const char); 2533 return sys_extattr_delete_link(l, &ua, retval); 2534 } 2535 2536 int 2537 netbsd32_extattr_list_fd(struct lwp *l, void *v, register_t *retval) 2538 { 2539 struct netbsd32_extattr_list_fd_args /* { 2540 syscallarg(int) fd; 2541 syscallarg(int) attrnamespace; 2542 syscallarg(netbsd32_voidp) data; 2543 syscallarg(netbsd32_size_t) nbytes; 2544 } */ *uap = v; 2545 struct sys_extattr_list_fd_args ua; 2546 2547 NETBSD32TO64_UAP(fd); 2548 NETBSD32TO64_UAP(attrnamespace); 2549 NETBSD32TOP_UAP(data, void); 2550 NETBSD32TOX_UAP(nbytes, size_t); 2551 return sys_extattr_list_fd(l, &ua, retval); 2552 } 2553 2554 int 2555 netbsd32_extattr_list_file(struct lwp *l, void *v, register_t *retval) 2556 { 2557 struct netbsd32_extattr_list_file_args /* { 2558 syscallarg(const netbsd32_charp) path; 2559 syscallarg(int) attrnamespace; 2560 syscallarg(netbsd32_voidp) data; 2561 syscallarg(netbsd32_size_t) nbytes; 2562 } */ *uap = v; 2563 struct sys_extattr_list_file_args ua; 2564 2565 NETBSD32TOP_UAP(path, const char); 2566 NETBSD32TO64_UAP(attrnamespace); 2567 NETBSD32TOP_UAP(data, void); 2568 NETBSD32TOX_UAP(nbytes, size_t); 2569 return sys_extattr_list_file(l, &ua, retval); 2570 } 2571 2572 int 2573 netbsd32_extattr_list_link(struct lwp *l, void *v, register_t *retval) 2574 { 2575 struct netbsd32_extattr_list_link_args /* { 2576 syscallarg(const netbsd32_charp) path; 2577 syscallarg(int) attrnamespace; 2578 syscallarg(netbsd32_voidp) data; 2579 syscallarg(netbsd32_size_t) nbytes; 2580 } */ *uap = v; 2581 struct sys_extattr_list_link_args ua; 2582 2583 NETBSD32TOP_UAP(path, const char); 2584 NETBSD32TO64_UAP(attrnamespace); 2585 NETBSD32TOP_UAP(data, void); 2586 NETBSD32TOX_UAP(nbytes, size_t); 2587 return sys_extattr_list_link(l, &ua, retval); 2588 } 2589 2590 int 2591 netbsd32_mlockall(l, v, retval) 2592 struct lwp *l; 2593 void *v; 2594 register_t *retval; 2595 { 2596 struct netbsd32_mlockall_args /* { 2597 syscallarg(int) flags; 2598 } */ *uap = v; 2599 struct sys_mlockall_args ua; 2600 2601 NETBSD32TO64_UAP(flags); 2602 return (sys_mlockall(l, &ua, retval)); 2603 } 2604 2605 int 2606 netbsd32___clone(struct lwp *l, void *v, register_t *retval) 2607 { 2608 struct netbsd32___clone_args /* { 2609 syscallarg(int) flags; 2610 syscallarg(netbsd32_voidp) stack; 2611 } */ *uap = v; 2612 struct sys___clone_args ua; 2613 2614 NETBSD32TO64_UAP(flags); 2615 NETBSD32TOP_UAP(stack, void); 2616 return sys___clone(l, &ua, retval); 2617 } 2618 2619 int 2620 netbsd32_fsync_range(struct lwp *l, void *v, register_t *retval) 2621 { 2622 struct netbsd32_fsync_range_args /* { 2623 syscallarg(int) fd; 2624 syscallarg(int) flags; 2625 syscallarg(off_t) start; 2626 syscallarg(off_t) length; 2627 } */ *uap = v; 2628 struct sys_fsync_range_args ua; 2629 2630 NETBSD32TO64_UAP(fd); 2631 NETBSD32TO64_UAP(flags); 2632 NETBSD32TO64_UAP(start); 2633 NETBSD32TO64_UAP(length); 2634 return (sys_fsync_range(l, &ua, retval)); 2635 } 2636 2637 int 2638 netbsd32_rasctl(struct lwp *l, void *v, register_t *retval) 2639 { 2640 struct netbsd32_rasctl_args /* { 2641 syscallarg(netbsd32_caddr_t) addr; 2642 syscallarg(netbsd32_size_t) len; 2643 syscallarg(int) op; 2644 } */ *uap = v; 2645 struct sys_rasctl_args ua; 2646 2647 NETBSD32TOX64_UAP(addr, caddr_t); 2648 NETBSD32TOX_UAP(len, size_t); 2649 NETBSD32TO64_UAP(op); 2650 return sys_rasctl(l, &ua, retval); 2651 } 2652 2653 int 2654 netbsd32_setxattr(struct lwp *l, void *v, register_t *retval) 2655 { 2656 struct netbsd32_setxattr_args /* { 2657 syscallarg(const netbsd32_charp) path; 2658 syscallarg(const netbsd32_charp) name; 2659 syscallarg(netbsd32_voidp) value; 2660 syscallarg(netbsd32_size_t) size; 2661 syscallarg(int) flags; 2662 } */ *uap = v; 2663 struct sys_setxattr_args ua; 2664 NETBSD32TOP_UAP(path, const char); 2665 NETBSD32TOP_UAP(name, const char); 2666 NETBSD32TOP_UAP(value, void); 2667 NETBSD32TOX_UAP(size, size_t); 2668 NETBSD32TO64_UAP(flags); 2669 return sys_setxattr(l, &ua, retval); 2670 } 2671 2672 int 2673 netbsd32_lsetxattr(struct lwp *l, void *v, register_t *retval) 2674 { 2675 struct netbsd32_lsetxattr_args /* { 2676 syscallarg(const netbsd32_charp) path; 2677 syscallarg(const netbsd32_charp) name; 2678 syscallarg(netbsd32_voidp) value; 2679 syscallarg(netbsd32_size_t) size; 2680 syscallarg(int) flags; 2681 } */ *uap = v; 2682 struct sys_lsetxattr_args ua; 2683 NETBSD32TOP_UAP(path, const char); 2684 NETBSD32TOP_UAP(name, const char); 2685 NETBSD32TOP_UAP(value, void); 2686 NETBSD32TOX_UAP(size, size_t); 2687 NETBSD32TO64_UAP(flags); 2688 return sys_lsetxattr(l, &ua, retval); 2689 } 2690 2691 int 2692 netbsd32_fsetxattr(struct lwp *l, void *v, register_t *retval) 2693 { 2694 struct netbsd32_fsetxattr_args /* { 2695 syscallarg(int) fd; 2696 syscallarg(const netbsd32_charp) name; 2697 syscallarg(netbsd32_voidp) value; 2698 syscallarg(netbsd32_size_t) size; 2699 syscallarg(int) flags; 2700 } */ *uap = v; 2701 struct sys_fsetxattr_args ua; 2702 NETBSD32TO64_UAP(fd); 2703 NETBSD32TOP_UAP(name, const char); 2704 NETBSD32TOP_UAP(value, void); 2705 NETBSD32TOX_UAP(size, size_t); 2706 NETBSD32TO64_UAP(flags); 2707 return sys_fsetxattr(l, &ua, retval); 2708 } 2709 2710 int 2711 netbsd32_getxattr(struct lwp *l, void *v, register_t *retval) 2712 { 2713 struct netbsd32_getxattr_args /* { 2714 syscallarg(const netbsd32_charp) path; 2715 syscallarg(const netbsd32_charp) name; 2716 syscallarg(netbsd32_voidp) value; 2717 syscallarg(netbsd32_size_t) size; 2718 } */ *uap = v; 2719 struct sys_getxattr_args ua; 2720 NETBSD32TOP_UAP(path, const char); 2721 NETBSD32TOP_UAP(name, const char); 2722 NETBSD32TOP_UAP(value, void); 2723 NETBSD32TOX_UAP(size, size_t); 2724 return sys_getxattr(l, &ua, retval); 2725 } 2726 2727 int 2728 netbsd32_lgetxattr(struct lwp *l, void *v, register_t *retval) 2729 { 2730 struct netbsd32_lgetxattr_args /* { 2731 syscallarg(const netbsd32_charp) path; 2732 syscallarg(const netbsd32_charp) name; 2733 syscallarg(netbsd32_voidp) value; 2734 syscallarg(netbsd32_size_t) size; 2735 } */ *uap = v; 2736 struct sys_lgetxattr_args ua; 2737 NETBSD32TOP_UAP(path, const char); 2738 NETBSD32TOP_UAP(name, const char); 2739 NETBSD32TOP_UAP(value, void); 2740 NETBSD32TOX_UAP(size, size_t); 2741 return sys_lgetxattr(l, &ua, retval); 2742 } 2743 2744 int 2745 netbsd32_fgetxattr(struct lwp *l, void *v, register_t *retval) 2746 { 2747 struct netbsd32_fgetxattr_args /* { 2748 syscallarg(int) fd; 2749 syscallarg(const netbsd32_charp) name; 2750 syscallarg(netbsd32_voidp) value; 2751 syscallarg(netbsd32_size_t) size; 2752 } */ *uap = v; 2753 struct sys_fgetxattr_args ua; 2754 NETBSD32TO64_UAP(fd); 2755 NETBSD32TOP_UAP(name, const char); 2756 NETBSD32TOP_UAP(value, void); 2757 NETBSD32TOX_UAP(size, size_t); 2758 return sys_fgetxattr(l, &ua, retval); 2759 } 2760 2761 int 2762 netbsd32_listxattr(struct lwp *l, void *v, register_t *retval) 2763 { 2764 struct netbsd32_listxattr_args /* { 2765 syscallarg(const netbsd32_charp) path; 2766 syscallarg(netbsd32_charp) list; 2767 syscallarg(netbsd32_size_t) size; 2768 } */ *uap = v; 2769 struct sys_listxattr_args ua; 2770 NETBSD32TOP_UAP(path, const char); 2771 NETBSD32TOP_UAP(list, char); 2772 NETBSD32TOX_UAP(size, size_t); 2773 return sys_listxattr(l, &ua, retval); 2774 } 2775 2776 int 2777 netbsd32_llistxattr(struct lwp *l, void *v, register_t *retval) 2778 { 2779 struct netbsd32_llistxattr_args /* { 2780 syscallarg(const netbsd32_charp) path; 2781 syscallarg(netbsd32_charp) list; 2782 syscallarg(netbsd32_size_t) size; 2783 } */ *uap = v; 2784 struct sys_llistxattr_args ua; 2785 NETBSD32TOP_UAP(path, const char); 2786 NETBSD32TOP_UAP(list, char); 2787 NETBSD32TOX_UAP(size, size_t); 2788 return sys_llistxattr(l, &ua, retval); 2789 } 2790 2791 int 2792 netbsd32_flistxattr(struct lwp *l, void *v, register_t *retval) 2793 { 2794 struct netbsd32_flistxattr_args /* { 2795 syscallarg(int) fd; 2796 syscallarg(netbsd32_charp) list; 2797 syscallarg(netbsd32_size_t) size; 2798 } */ *uap = v; 2799 struct sys_flistxattr_args ua; 2800 NETBSD32TO64_UAP(fd); 2801 NETBSD32TOP_UAP(list, char); 2802 NETBSD32TOX_UAP(size, size_t); 2803 return sys_flistxattr(l, &ua, retval); 2804 } 2805 2806 int 2807 netbsd32_removexattr(struct lwp *l, void *v, register_t *retval) 2808 { 2809 struct netbsd32_removexattr_args /* { 2810 syscallarg(const netbsd32_charp) path; 2811 syscallarg(const netbsd32_charp) name; 2812 } */ *uap = v; 2813 struct sys_removexattr_args ua; 2814 NETBSD32TOP_UAP(path, const char); 2815 NETBSD32TOP_UAP(name, const char); 2816 return sys_removexattr(l, &ua, retval); 2817 } 2818 2819 int 2820 netbsd32_lremovexattr(struct lwp *l, void *v, register_t *retval) 2821 { 2822 struct netbsd32_lremovexattr_args /* { 2823 syscallarg(const netbsd32_charp) path; 2824 syscallarg(const netbsd32_charp) name; 2825 } */ *uap = v; 2826 struct sys_lremovexattr_args ua; 2827 NETBSD32TOP_UAP(path, const char); 2828 NETBSD32TOP_UAP(name, const char); 2829 return sys_lremovexattr(l, &ua, retval); 2830 } 2831 2832 int 2833 netbsd32_fremovexattr(struct lwp *l, void *v, register_t *retval) 2834 { 2835 struct netbsd32_fremovexattr_args /* { 2836 syscallarg(int) fd; 2837 syscallarg(const netbsd32_charp) name; 2838 } */ *uap = v; 2839 struct sys_fremovexattr_args ua; 2840 NETBSD32TO64_UAP(fd); 2841 NETBSD32TOP_UAP(name, const char); 2842 return sys_fremovexattr(l, &ua, retval); 2843 } 2844