{"action":"opened","issue":{"url":"https://api.github.com/repos/cl21/cl21/issues/96","repository_url":"https://api.github.com/repos/cl21/cl21","labels_url":"https://api.github.com/repos/cl21/cl21/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/cl21/cl21/issues/96/comments","events_url":"https://api.github.com/repos/cl21/cl21/issues/96/events","html_url":"https://github.com/cl21/cl21/issues/96","id":181994252,"number":96,"title":"[cl21.process] Use trivial-signal?","user":{"login":"pipping","id":61962,"avatar_url":"https://avatars.githubusercontent.com/u/61962?v=3","gravatar_id":"","url":"https://api.github.com/users/pipping","html_url":"https://github.com/pipping","followers_url":"https://api.github.com/users/pipping/followers","following_url":"https://api.github.com/users/pipping/following{/other_user}","gists_url":"https://api.github.com/users/pipping/gists{/gist_id}","starred_url":"https://api.github.com/users/pipping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pipping/subscriptions","organizations_url":"https://api.github.com/users/pipping/orgs","repos_url":"https://api.github.com/users/pipping/repos","events_url":"https://api.github.com/users/pipping/events{/privacy}","received_events_url":"https://api.github.com/users/pipping/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-10T11:40:18Z","updated_at":"2016-10-10T11:40:18Z","closed_at":null,"body":"process.lisp currently hardcodes\r\n```common-lisp\r\n(defconstant +sigkill+ 9)\r\n(defconstant +sigterm+ 15)\r\n(defconstant +sigstop+ 17)\r\n(defconstant +sigcont+ 19)\r\n```\r\n\r\nNaturally, this list is incomplete, but it's also clearly not portable (e.g. `SIGSTOP` is 17 on my macOS box and 19 on my linux box). If one can rely on CFFI, this issue can be trivially solved (and trivial-signal [has done that](https://github.com/guicho271828/trivial-signal/blob/master/src/signals.lisp), I believe).\r\n\r\nIf one does not want to depend on CFFI directly for whatever reason: Quite a few CL implementations give access to a name-to-number signal translation facility one way or another. Here's a bit of sample code:\r\n\r\n```common-lisp\r\n(defmacro %resolve-symbol (symbol package)\r\n  `(symbol-value (find-symbol (symbol-name ,symbol) ,package)))\r\n\r\n(defmacro define-signal (name\r\n                         regular-symbol variable-symbol constant-symbol)\r\n  (declare (ignore\r\n            #-(or clozure cmucl mkcl sbcl) regular-symbol\r\n            #-(or allegro) variable-symbol\r\n            #-(or ecl) constant-symbol))\r\n  `(defconstant ,name\r\n     #+allegro (%resolve-symbol ,variable-symbol :excl)\r\n     #+clozure (symbol-value (read-from-string\r\n                              ,(concatenate 'string \"#$\"\r\n                                            (string-upcase\r\n                                             (symbol-name regular-symbol)))))\r\n     #+cmucl (%resolve-symbol ,regular-symbol :unix)\r\n     #+ecl (%resolve-symbol ,constant-symbol :ext)\r\n     #+mkcl (progn (require :mk-unix)\r\n                   (%resolve-symbol ,regular-symbol :mk-unix))\r\n     #+sbcl (progn (require :sb-posix)\r\n                   (%resolve-symbol ,regular-symbol :sb-posix))))\r\n\r\n(define-signal +sigstop+ :sigstop :*sigstop* :+sigstop+)\r\n```\r\n(Warning: There's a bug in Allegro CL 10.0: `SIGCONT` is not defined. I've already reported this.)"}}
{"actor":{"display_login":"pipping"}}