Subversion Repositories HelenOS

Rev

Rev 2486 | Rev 2615 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2486 Rev 2564
Line 146... Line 146...
146
            &rights, NULL);
146
            &rights, NULL);
147
        if (res) {
147
        if (res) {
148
            printf("Failed to initialize timeofday memarea\n");
148
            printf("Failed to initialize timeofday memarea\n");
149
            _exit(1);
149
            _exit(1);
150
        }
150
        }
151
        if (! (rights & AS_AREA_READ)) {
151
        if (!(rights & AS_AREA_READ)) {
152
            printf("Received bad rights on time area: %X\n",
152
            printf("Received bad rights on time area: %X\n",
153
                   rights);
153
                rights);
154
            as_area_destroy(mapping);
154
            as_area_destroy(mapping);
155
            _exit(1);
155
            _exit(1);
156
        }
156
        }
157
        ktime = mapping;
157
        ktime = mapping;
158
    }
158
    }
Line 173... Line 173...
173
        tv->tv_sec = s1;
173
        tv->tv_sec = s1;
174
 
174
 
175
    return 0;
175
    return 0;
176
}
176
}
177
 
177
 
-
 
178
time_t time(time_t *tloc)
-
 
179
{
-
 
180
    struct timeval tv;
-
 
181
 
-
 
182
    if (gettimeofday(&tv, NULL))
-
 
183
        return (time_t) -1;
-
 
184
    if (tloc)
-
 
185
        *tloc = tv.tv_sec;
-
 
186
    return tv.tv_sec;
-
 
187
}
-
 
188
 
178
/** Wait unconditionally for specified number of microseconds */
189
/** Wait unconditionally for specified number of microseconds */
179
void usleep(unsigned long usec)
190
void usleep(unsigned long usec)
180
{
191
{
181
    atomic_t futex = FUTEX_INITIALIZER;
192
    atomic_t futex = FUTEX_INITIALIZER;
182
 
193