Update contrib.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 // Contains the source for fchdir
25 #include <sys/utsname.h>
34 The uname function stores NUL -terminated strings of information
35 identifying the current system into the structure referenced by buf.
37 The utsname structure is defined in the
39 #include <sys/utsname.h> header file, and contains the following members:
40 sysname Name of the operating system implementation.
41 nodename Network name of this machine.
42 release Release level of the operating system.
43 version Version level of the operating system.
44 machine Machine hardware platform.
46 Upon successful completion, a non-negative value shall be returned.
47 Otherwise, -1 shall be returned and errno set to indicate the error.
51 EXPORT_C int uname(struct utsname *buf)
54 char name[KMaxFileName], buffer[KValBuf];
55 size_t len = KMaxFileName;
56 char* retDest2 = NULL;
57 char* retDest4 = NULL;
62 char* retDest1 = strcpy(buf->sysname, "Symbian");
65 int retGetHostName = gethostname(name, len);
69 retDest2 = strncpy (buf->nodename , name, SYS_NMLN);
70 buf->nodename[SYS_NMLN-1] = '\0';
75 char* retDest3 = strcpy (buf->release , "\0");
78 TVersion rett = User::Version();
79 int retNoOfBytes = sprintf(buffer, "%d:%d:%d", rett.iMajor, rett.iMinor, rett.iBuild);
82 retDest4 = strcpy (buf->version , buffer);
87 char* retDest5 = strcpy (buf->machine , "\0");
90 if((retDest1!=NULL)&&(retDest2!=NULL)&&(retDest3!=NULL)&&(retDest4!=NULL)&&(retDest5!=NULL))