@@ -518,3 +518,34 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
518
518
MOVL $1 , DX // FD_CLOEXEC
519
519
INVOKE_SYSINFO
520
520
RET
521
+
522
+ // int access(const char *name, int mode)
523
+ TEXT runtime·access(SB),NOSPLIT,$0
524
+ MOVL $33 , AX // syscall - access
525
+ MOVL name+0 (FP), BX
526
+ MOVL mode+4 (FP), CX
527
+ INVOKE_SYSINFO
528
+ MOVL AX, ret +8 (FP)
529
+ RET
530
+
531
+ // int connect(int fd, const struct sockaddr *addr, socklen_t addrlen)
532
+ TEXT runtime·connect(SB),NOSPLIT,$0 -16
533
+ // connect is implemented as socketcall(NR_socket, 3, *(rest of args))
534
+ // stack already should have fd, addr, addrlen.
535
+ MOVL $102 , AX // syscall - socketcall
536
+ MOVL $3 , BX // connect
537
+ LEAL fd+0 (FP), CX
538
+ INVOKE_SYSINFO
539
+ MOVL AX, ret +12 (FP)
540
+ RET
541
+
542
+ // int socket(int domain, int type, int protocol)
543
+ TEXT runtime·socket(SB),NOSPLIT,$0 -16
544
+ // socket is implemented as socketcall(NR_socket, 1, *(rest of args))
545
+ // stack already should have domain, type, protocol.
546
+ MOVL $102 , AX // syscall - socketcall
547
+ MOVL $1 , BX // socket
548
+ LEAL domain+0 (FP), CX
549
+ INVOKE_SYSINFO
550
+ MOVL AX, ret +12 (FP)
551
+ RET
0 commit comments