rhel 7
obsolete weakness #289

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:

bltk/tools/xse/xse.c

Context:

The highlighted line of code below is the trigger point of this particular Red Hat Enterprise Linux 7 obsolete weakness.

 		ret = sscanf(var, "%Lf", &time_and_space);
		if (ret != 1) {
			(void)fprintf(stderr,
				      "%s: Invalid BLTK_TIME_AND_SPACE=%s\n",
				      progname, var);
			xse_exit(1);
		}
		time_and_space_flg = 1;
	}
}

void delay(int msecs)
{
	ll_t t;
	ld_t msecs1;

	t = gettime();

	msecs = msecs * 1000;
	if (time_and_space_flg) {
		msecs1 = msecs * time_and_space;
		msecs = msecs1;
	}

	usleep(msecs);

	t = gettime() - t;
	user_delay += t;
}

void real_delay(int msecs)
{
	ll_t t;

	t = gettime();

	msecs = msecs * 1000;

	usleep(msecs);

	t = gettime() - t;
	user_delay += t;
}

void delay2(int msecs)
{
	usleep(msecs * 1000);
}

ll_t gettime(void) 

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.