5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2006 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
26 /* Returns the username of the user. */
28 char *silc_get_username()
36 pw = getpwuid(getuid());
38 return strdup("User");
40 logname = pw->pw_name;
43 return strdup(logname);
46 /* Returns the real name of ther user. */
48 char *silc_get_real_name()
50 char *realname = NULL;
53 pw = getpwuid(getuid());
55 return strdup("No Name");
57 if (strchr(pw->pw_gecos, ','))
58 *strchr(pw->pw_gecos, ',') = 0;
60 if (!strlen(pw->pw_gecos))
61 return strdup("No Name");
63 realname = strdup(pw->pw_gecos);
68 /* Return current time to struct timeval. */
70 int silc_gettimeofday(struct timeval *p)
72 return gettimeofday(p, NULL);
75 int silc_file_set_nonblock(int fd)
80 void silc_symbian_usleep(long microseconds)
82 User::After(microseconds / 1000);
85 void silc_symbian_debug(const char *function, int line, char *string)
87 RDebug::Print(_L("%s:%d: %s"), function, line, string);