centos 6
obsolete weakness #33

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

spice-0.8.2/client/x11/platform.cpp

Context:

The highlighted line of code below is the trigger point of this particular Centos 6 obsolete weakness.

 
uint64_t Platform::get_process_id()
{
    static uint64_t pid = uint64_t(getpid());
    return pid;
}

uint64_t Platform::get_thread_id()
{
    return uint64_t(syscall(SYS_gettid));
}

void Platform::error_beep()
{
    if (!x_display) {
        return;
    }

    XBell(x_display, 0);
    XFlush(x_display);
}

void Platform::msleep(unsigned int millisec)
{
    usleep(millisec * 1000);
}

void Platform::yield()
{
    POSIX_YIELD_FUNC;
}

void Platform::term_printf(const char* format, ...)
{
    va_list ap;
    va_start(ap, format);
    vprintf(format, ap);
    va_end(ap);
}

void Platform::set_thread_priority(void* thread, Platform::ThreadPriority in_priority)
{
    ASSERT(thread == NULL);
    int priority;

    switch (in_priority) {
    case PRIORITY_TIME_CRITICAL:
        priority = -20;
        break;
    case PRIORITY_HIGH: 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.