<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>Raymond Toy pushed to branch rtoy-grand-unix-unification at <a href="https://gitlab.common-lisp.net/cmucl/cmucl">cmucl / cmucl</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/95279cabd8a73af41a1f2c2463c9c9f1fe6fbdee">95279cab</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-10-19T22:02:24Z</i>
</div>
<pre class='commit-message'>Move over more items from unix-glibc2.lisp.
These should be the last things that need to be moved.</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/code/unix.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/commit/95279cabd8a73af41a1f2c2463c9c9f1fe6fbdee#diff-0'>
<strong>
src/code/unix.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/code/unix.lisp
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/code/unix.lisp
</span><span style="color: #aaaaaa">@@ -650,6 +650,20 @@
</span> (declare (type unix-fd fd))
(int-syscall ("dup" int) fd))
<span style="color: #000000;background-color: #ddffdd">+;;; Unix-dup2 makes the second file-descriptor describe the same file
+;;; as the first. If the second file-descriptor points to an open
+;;; file, it is first closed. In any case, the second should have a
+;;; value which is a valid file-descriptor.
+
+(defun unix-dup2 (fd1 fd2)
+ _N"Unix-dup2 duplicates an existing file descriptor just as unix-dup
+ does only the new value of the duplicate descriptor may be requested
+ through the second argument. If a file already exists with the
+ requested descriptor number, it will be closed and the number
+ assigned to the duplicate."
+ (declare (type unix-fd fd1 fd2))
+ (void-syscall ("dup2" int int) fd1 fd2))
+
</span> ;;; Unix-fcntl takes a file descriptor, an integer command
;;; number, and optional command arguments. It performs
;;; operations on the associated file and/or returns inform-
<span style="color: #aaaaaa">@@ -686,8 +700,8 @@
</span> #+osf1 #o100000
#-(or linux osf1) #o0004
_N"Non-blocking reads")
<span style="color: #000000;background-color: #ffdddd">-(defconstant FAPPEND #-linux #o0010 #+linux #o2000 _N"Append on each write")
-(defconstant FASYNC #-(or linux svr4) #o0100 #+svr4 #o10000 #+linux #o20000
</span><span style="color: #000000;background-color: #ddffdd">+(defconstant FAPPEND #-linux #o0010 #+linux o_append _N"Append on each write")
+(defconstant FASYNC #-(or linux svr4) #o0100 #+svr4 #o10000 #+linux o_asyn
</span> _N"Signal pgrp when data ready")
;; doesn't exist in Linux ;-(
#-linux (defconstant FCREAT #-(or hpux svr4) #o1000 #+(or hpux svr4) #o0400
<span style="color: #aaaaaa">@@ -907,7 +921,7 @@
</span>
;; output modes
#-bsd (def-enum ash 1 tty-opost tty-olcuc tty-onlcr tty-ocrnl tty-onocr
<span style="color: #000000;background-color: #ffdddd">- tty-onlret tty-ofill tty-ofdel)
</span><span style="color: #000000;background-color: #ddffdd">+ tty-onlret tty-ofill tty-ofdel #+linux tty-nldly)
</span> #+bsd (def-enum ash 1 tty-opost tty-onlcr)
;; local modes
<span style="color: #aaaaaa">@@ -1658,15 +1672,15 @@
</span>
;;;; Support routines for dealing with unix pathnames.
<span style="color: #000000;background-color: #ffdddd">-(defconstant s-ifmt #o0170000)
-(defconstant s-ifdir #o0040000)
-(defconstant s-ifchr #o0020000)
</span><span style="color: #000000;background-color: #ddffdd">+(defconstant s-ifmt #o0170000 _N"These bits determine file type.")
+(defconstant s-ifdir #o0040000 _N"Directory")
+(defconstant s-ifchr #o0020000 _N"Character device")
</span> #+linux
(defconstant s-ififo #o0010000 _N"FIFO")
<span style="color: #000000;background-color: #ffdddd">-(defconstant s-ifblk #o0060000)
-(defconstant s-ifreg #o0100000)
-(defconstant s-iflnk #o0120000)
-(defconstant s-ifsock #o0140000)
</span><span style="color: #000000;background-color: #ddffdd">+(defconstant s-ifblk #o0060000 _N"Block device")
+(defconstant s-ifreg #o0100000 _N"Regular file")
+(defconstant s-iflnk #o0120000 _N"Symbolic link.")
+(defconstant s-ifsock #o0140000 _N"Socket.")
</span> (defconstant s-isuid #o0004000)
(defconstant s-isgid #o0002000)
(defconstant s-isvtx #o0001000)
<span style="color: #aaaaaa">@@ -2291,8 +2305,9 @@
</span>
(def-alien-type nil
(struct timeval
<span style="color: #000000;background-color: #ffdddd">- (tv-sec #-linux time-t #+linux int) ; seconds
- (tv-usec int))) ; and microseconds
</span><span style="color: #000000;background-color: #ddffdd">+ (tv-sec time-t) ; seconds
+ (tv-usec #-linux int
+ #+linux time-t))) ; and microseconds
</span>
(def-alien-type nil
(struct timezone
<span style="color: #aaaaaa">@@ -2609,6 +2624,7 @@
</span> (defconstant ITIMER-VIRTUAL 1)
(defconstant ITIMER-PROF 2)
<span style="color: #000000;background-color: #ddffdd">+#-linux
</span> (defun unix-setitimer (which int-secs int-usec val-secs val-usec)
_N" Unix-setitimer sets the INTERVAL and VALUE slots of one of
three system timers (:real :virtual or :profile). A SIGALRM signal
<span style="color: #aaaaaa">@@ -2644,6 +2660,28 @@
</span> (slot (slot itvo 'it-value) 'tv-usec))
which (alien-sap (addr itvn))(alien-sap (addr itvo))))))
<span style="color: #000000;background-color: #ddffdd">+#+linux
+(defun unix-getitimer (which)
+ _N"Unix-getitimer returns the INTERVAL and VALUE slots of one of
+ three system timers (:real :virtual or :profile). On success,
+ unix-getitimer returns 5 values,
+ T, it-interval-secs, it-interval-usec, it-value-secs, it-value-usec."
+ (declare (type (member :real :virtual :profile) which)
+ (values t
+ (unsigned-byte 29)(mod 1000000)
+ (unsigned-byte 29)(mod 1000000)))
+ (let ((which (ecase which
+ (:real ITIMER-REAL)
+ (:virtual ITIMER-VIRTUAL)
+ (:profile ITIMER-PROF))))
+ (with-alien ((itv (struct itimerval)))
+ (syscall* ("getitimer" int (* (struct itimerval)))
+ (values T
+ (slot (slot itv 'it-interval) 'tv-sec)
+ (slot (slot itv 'it-interval) 'tv-usec)
+ (slot (slot itv 'it-value) 'tv-sec)
+ (slot (slot itv 'it-value) 'tv-usec))
+ which (alien-sap (addr itv))))))
</span>
;;;; User and group database access, POSIX Standard 9.2.2
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/95279cabd8a73af41a1f2c2463c9c9f1fe6fbdee">View it on GitLab</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.common-lisp.net/cmucl/cmucl/commit/95279cabd8a73af41a1f2c2463c9c9f1fe6fbdee"}}</script>
</p>
</div>
</body>
</html>