| 
									
										
										
										
											2008-12-06 23:58:19 -05:00
										 |  |  | ! Copyright (C) 2008 Doug Coleman. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2011-09-09 00:59:03 -04:00
										 |  |  | USING: alien.c-types alien.syntax byte-arrays io | 
					
						
							|  |  |  | io.encodings.string io.encodings.utf8 io.streams.byte-array | 
					
						
							|  |  |  | kernel sequences splitting strings system system-info unix ;
 | 
					
						
							| 
									
										
										
										
											2008-12-06 23:58:19 -05:00
										 |  |  | IN: system-info.linux | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-14 19:00:11 -04:00
										 |  |  | FUNCTION-ALIAS: (uname) | 
					
						
							|  |  |  |     int uname ( c-string buf ) ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : uname ( -- seq )
 | 
					
						
							| 
									
										
										
										
											2011-09-09 00:59:03 -04:00
										 |  |  |     65536 <byte-array> [ (uname) io-error ] keep >string
 | 
					
						
							|  |  |  |     "\0" split harvest dup length 6 assert= ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-09 00:59:03 -04:00
										 |  |  | : sysname ( -- string ) 0 uname nth ;
 | 
					
						
							|  |  |  | : nodename ( -- string ) 1 uname nth ;
 | 
					
						
							|  |  |  | : release ( -- string ) 2 uname nth ;
 | 
					
						
							|  |  |  | : version ( -- string ) 3 uname nth ;
 | 
					
						
							|  |  |  | : machine ( -- string ) 4 uname nth ;
 | 
					
						
							|  |  |  | : domainname ( -- string ) 5 uname nth ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-09 00:59:03 -04:00
										 |  |  | M: linux os-version release ;
 |