![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Human readable type vs MIME type detection using file | spauldingsmails | Shell Programming and Scripting | 0 | 03-21-2007 09:43 PM |
| Need help in choosing Unix Platform. | justanoob | UNIX for Dummies Questions & Answers | 3 | 03-10-2005 12:45 AM |
| Porting of Windows written unix scripts to unix platform | tamilselvi | UNIX for Advanced & Expert Users | 7 | 10-02-2002 07:55 AM |
| How to programm TTY devices under UNIX platform? | WayneYang | High Level Programming | 8 | 12-28-2001 02:15 AM |
| C++ on True Unix Platform | mandar3 | High Level Programming | 2 | 10-15-2001 08:13 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Platform type in Unix
Hi all,
How does one get the platform type in UNIX (for e.g. sparc/i386)? I need an function call and not the command like uname -p. thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
See if you have the uname system call available on your machine. Check for man 2 uname
|
|
#3
|
|||
|
|||
|
It is there but it doesn't give platform type/architecture
|
|
#4
|
||||
|
||||
|
You are seeing a following example.
Code:
#include <sys/utsname.h>
main()
{
struct utsname sys_inf;
uname(&sys_inf);
printf("System name - %s \n", sys_inf.sysname);
printf("Nodename - %s \n", sys_inf.nodename);
printf("Release - %s \n", sys_inf.release);
printf("Version - %s \n", sys_inf.version);
printf("Machine - %s \n", sys_inf.machine);
}
Iliyan Varshilov Last edited by ilko_partizan; 06-07-2007 at 01:37 AM. |
|
#5
|
|||
|
|||
|
Quote:
For example, a C compiler may predefine one of the following as #defines: __ppc__ __386__ __x86_64__ __mips__ __sparc__ or __sparc __hppa __alpha Also, look at "config.guess" |
|
#6
|
|||
|
|||
|
Quote:
But none of them gives processor architecture |
|
#7
|
|||
|
|||
|
how do i remove this -l
-rw-r--r-- 1 ananias ananias 2050 Jun 5 12:59 -l
how do i remove such a filename -l, that i exdentaly created but if u do ls -al it say it cannot open and it i say cat -l cat: illegal option -- l usage: cat [-benstuv] [file ...] |
|||
| Google The UNIX and Linux Forums |