(syscall-dup-logic oldfd x86) → (mv * x86)
From the
int dup(int oldfd);
Function:
(defun syscall-dup-logic (oldfd x86) (declare (xargs :stobjs (x86))) (declare (ignorable oldfd x86)) (declare (xargs :guard (integerp oldfd))) (let ((__function__ 'syscall-dup-logic)) (declare (ignorable __function__)) (b* ((obj-fd-field (read-x86-file-des oldfd x86)) ((when (not (file-descriptor-fieldp obj-fd-field))) (b* ((- (cw "~%Error: File Descriptor Field ill-formed. Maybe these books were ~ not built with X86ISA_EXEC set to t? See :doc x86isa-build-instructions.~%~%")) (x86 (!ms (list (rip x86) "File Descriptor Field ill-formed. Maybe these books were ~ not built with X86ISA_EXEC set to t? See :doc x86isa-build-instructions." (ms x86)) x86))) (mv -1 x86))) ((mv newfd x86) (pop-x86-oracle x86)) ((when (not (integerp newfd))) (b* ((- (cw "~%Error: New file descriptor not an integer.~%~%")) (x86 (!ms (list (rip x86) "New file descriptor not an integer" newfd (ms x86)) x86))) (mv -1 x86)))) (mv newfd x86))))