<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-unix-core 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/16f35f1a83c093309b7d4486d20417ede7998e0b">16f35f1a</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-05-09T15:15:11Z</i>
</div>
<pre class='commit-message'>Add UNIX functions that were previously missed.</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/code/unix-glibc2.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/commit/16f35f1a83c093309b7d4486d20417ede7998e0b#diff-0'>
<strong>
src/code/unix-glibc2.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/code/unix-glibc2.lisp
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/code/unix-glibc2.lisp
</span><span style="color: #aaaaaa">@@ -667,6 +667,21 @@
</span> (declare (type unix-fd fd))
(void-syscall ("close" int) fd))
<span style="color: #000000;background-color: #ddffdd">+;;; Unix-creat accepts a file name and a mode. It creates a new file
+;;; with name and sets it mode to mode (as for chmod).
+
+(defun unix-creat (name mode)
+ _N"Unix-creat accepts a file name and a mode (same as those for
+ unix-chmod) and creates a file by that name with the specified
+ permission mode. It returns a file descriptor on success,
+ or NIL and an error number otherwise.
+
+ This interface is made obsolete by UNIX-OPEN."
+
+ (declare (type unix-pathname name)
+ (type unix-file-mode mode))
+ (int-syscall ("creat64" c-string int) (%name->file name) mode))
+
</span> (defun unix-resolve-links (pathname)
_N"Returns the pathname with all symbolic links resolved."
(declare (simple-string pathname))
<span style="color: #aaaaaa">@@ -907,6 +922,19 @@
</span> (type unix-file-mode mode))
(void-syscall ("chmod" c-string int) (%name->file path) mode))
<span style="color: #000000;background-color: #ddffdd">+;;; Unix-fchmod accepts a file descriptor ("fd") and a file protection mode
+;;; ("mode") and changes the protection of the file described by "fd" to
+;;; "mode".
+
+(defun unix-fchmod (fd mode)
+ _N"Given an integer file descriptor and a mode (the same as those
+ used for unix-chmod), unix-fchmod changes the permission mode
+ for that file to the one specified. T is returned if the call
+ was successful."
+ (declare (type unix-fd fd)
+ (type unix-file-mode mode))
+ (void-syscall ("fchmod" int int) fd mode))
+
</span> (defun unix-readlink (path)
_N"Unix-readlink invokes the readlink system call on the file name
specified by the simple string path. It returns up to two values:
<span style="color: #aaaaaa">@@ -1023,6 +1051,14 @@
</span> (void-syscall ("rename" c-string c-string)
(%name->file name1) (%name->file name2)))
<span style="color: #000000;background-color: #ddffdd">+;;; Unix-rmdir accepts a name and removes the associated directory.
+
+(defun unix-rmdir (name)
+ _N"Unix-rmdir attempts to remove the directory name. NIL and
+ an error number is returned if an error occured."
+ (declare (type unix-pathname name))
+ (void-syscall ("rmdir" c-string) (%name->file name)))
+
</span> (def-alien-type fd-mask #-alpha unsigned-long #+alpha unsigned-int)
(defconstant fd-setsize 1024)
<span style="color: #aaaaaa">@@ -1101,6 +1137,9 @@
</span> (define-ioctl-command TIOCSPGRP #\T #x10)
(define-ioctl-command TIOCGPGRP #\T #x0F)
<span style="color: #000000;background-color: #ddffdd">+;;; File ioctl commands.
+(define-ioctl-command FIONREAD #\T #x1B)
+
</span> ;;; ioctl-types.h
(def-alien-type nil
<span style="color: #aaaaaa">@@ -1503,6 +1542,28 @@
</span> (addr tv)
(addr tz))))
<span style="color: #000000;background-color: #ddffdd">+;;; Unix-utimes changes the accessed and updated times on UNIX
+;;; files. The first argument is the filename (a string) and
+;;; the second argument is a list of the 4 times- accessed and
+;;; updated seconds and microseconds.
+
+(defun unix-utimes (file atime-sec atime-usec mtime-sec mtime-usec)
+ _N"Unix-utimes sets the 'last-accessed' and 'last-updated'
+ times on a specified file. NIL and an error number is
+ returned if the call is unsuccessful."
+ (declare (type unix-pathname file)
+ (type (alien unsigned-long)
+ atime-sec atime-usec
+ mtime-sec mtime-usec))
+ (with-alien ((tvp (array (struct timeval) 2)))
+ (setf (slot (deref tvp 0) 'tv-sec) atime-sec)
+ (setf (slot (deref tvp 0) 'tv-usec) atime-usec)
+ (setf (slot (deref tvp 1) 'tv-sec) mtime-sec)
+ (setf (slot (deref tvp 1) 'tv-usec) mtime-usec)
+ (void-syscall ("utimes" c-string (* (struct timeval)))
+ file
+ (cast tvp (* (struct timeval))))))
+
</span> (def-alien-routine ("ttyname" unix-ttyname) c-string
(fd int))
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/16f35f1a83c093309b7d4486d20417ede7998e0b">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/16f35f1a83c093309b7d4486d20417ede7998e0b"}}</script>
</p>
</div>
</body>
</html>