Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1eb753cd25 | |||
| 19769f795b | |||
| 5b44332cff | |||
| 0d50fad855 | |||
| a37c850d1b | |||
| 1eca7a502a | |||
| 80e24fa9db | |||
| 15bded54c9 | |||
| 2a0db42072 | |||
| de82bf893a | |||
| a0bb06189d | |||
| a8513ae614 | |||
| 0c203c1e57 | |||
| 93658ba478 | |||
| 58aea01f5a | |||
| d39ed70c65 | |||
| 3e6bab5158 | |||
| 672cff7ee5 | |||
| 3ad07bc40f | |||
| 1e8d5baf8c |
@@ -700,6 +700,8 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
INT32 los_get_diskid_byname(const CHAR *diskName);
|
INT32 los_get_diskid_byname(const CHAR *diskName);
|
||||||
|
INT32 DiskEventRead(void);
|
||||||
|
INT32 DiskEventInit(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
|
|||||||
+35
-3
@@ -58,6 +58,10 @@ spinlock_t g_diskFatBlockSpinlock;
|
|||||||
|
|
||||||
UINT32 g_usbMode = 0;
|
UINT32 g_usbMode = 0;
|
||||||
|
|
||||||
|
#ifdef LOSCFG_STORAGE_EMMC
|
||||||
|
static struct tagEvent g_diskInitEvent;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MEM_ADDR_ALIGN_BYTE 64
|
#define MEM_ADDR_ALIGN_BYTE 64
|
||||||
#define RWE_RW_RW 0755
|
#define RWE_RW_RW 0755
|
||||||
|
|
||||||
@@ -1275,20 +1279,20 @@ static INT32 DiskDeinit(los_disk *disk)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
disk->dev = NULL;
|
disk->dev = NULL;
|
||||||
DISK_UNLOCK(&disk->disk_mutex);
|
|
||||||
(VOID)unregister_blockdriver(disk->disk_name);
|
(VOID)unregister_blockdriver(disk->disk_name);
|
||||||
if (disk->disk_name != NULL) {
|
if (disk->disk_name != NULL) {
|
||||||
LOS_MemFree(m_aucSysMem0, disk->disk_name);
|
LOS_MemFree(m_aucSysMem0, disk->disk_name);
|
||||||
disk->disk_name = NULL;
|
disk->disk_name = NULL;
|
||||||
}
|
}
|
||||||
|
DISK_UNLOCK(&disk->disk_mutex);
|
||||||
|
disk->disk_status = STAT_UNUSED;
|
||||||
ret = pthread_mutex_destroy(&disk->disk_mutex);
|
ret = pthread_mutex_destroy(&disk->disk_mutex);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
PRINT_ERR("%s %d, mutex destroy failed, ret = %d\n", __FUNCTION__, __LINE__, ret);
|
PRINT_ERR("%s %d, mutex destroy failed, ret = %d\n", __FUNCTION__, __LINE__, ret);
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
disk->disk_status = STAT_UNUSED;
|
|
||||||
|
|
||||||
return ENOERR;
|
return ENOERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1360,6 +1364,16 @@ INT32 los_disk_init(const CHAR *diskName, const struct block_operations *bops,
|
|||||||
} else {
|
} else {
|
||||||
disk->type = OTHERS;
|
disk->type = OTHERS;
|
||||||
}
|
}
|
||||||
|
#ifdef LOSCFG_STORAGE_EMMC
|
||||||
|
ret = LOS_EventWrite(&g_diskInitEvent, 1);
|
||||||
|
if (ret < 0) {
|
||||||
|
PRINT_ERR("Disk initialization event write fail \n");
|
||||||
|
(void)unregister_blockdriver(diskName);
|
||||||
|
disk->disk_status = STAT_UNUSED;
|
||||||
|
return VFS_ERROR;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return ENOERR;
|
return ENOERR;
|
||||||
|
|
||||||
DISK_BLKDRIVER_ERROR:
|
DISK_BLKDRIVER_ERROR:
|
||||||
@@ -1370,6 +1384,24 @@ DISK_FIND_ERROR:
|
|||||||
return VFS_ERROR;
|
return VFS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 DiskEventInit(void)
|
||||||
|
{
|
||||||
|
#ifdef LOSCFG_STORAGE_EMMC
|
||||||
|
return LOS_EventInit(&g_diskInitEvent);
|
||||||
|
#else
|
||||||
|
return LOS_OK;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 DiskEventRead(void)
|
||||||
|
{
|
||||||
|
#ifdef LOSCFG_STORAGE_EMMC
|
||||||
|
return LOS_EventRead(&g_diskInitEvent, 1, LOS_WAITMODE_OR, LOS_WAIT_FOREVER);
|
||||||
|
#else
|
||||||
|
return LOS_OK;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
INT32 los_disk_deinit(INT32 diskID)
|
INT32 los_disk_deinit(INT32 diskID)
|
||||||
{
|
{
|
||||||
los_disk *disk = get_disk(diskID);
|
los_disk *disk = get_disk(diskID);
|
||||||
|
|||||||
@@ -838,6 +838,10 @@ static int os_shell_cmd_do_rmdir(const char *pathname)
|
|||||||
return remove(pathname);
|
return remove(pathname);
|
||||||
}
|
}
|
||||||
d = opendir(pathname);
|
d = opendir(pathname);
|
||||||
|
if (d == NULL)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
dirent = readdir(d);
|
dirent = readdir(d);
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ extern "C" {
|
|||||||
|
|
||||||
#if (LOSCFG_KERNEL_SMP_LOCKDEP == YES)
|
#if (LOSCFG_KERNEL_SMP_LOCKDEP == YES)
|
||||||
|
|
||||||
|
#define PRINT_BUF_SIZE 256
|
||||||
|
|
||||||
#define LOCKDEP_GET_NAME(lockDep, index) (((SPIN_LOCK_S *)((lockDep)->heldLocks[(index)].lockPtr))->name)
|
#define LOCKDEP_GET_NAME(lockDep, index) (((SPIN_LOCK_S *)((lockDep)->heldLocks[(index)].lockPtr))->name)
|
||||||
#define LOCKDEP_GET_ADDR(lockDep, index) ((lockDep)->heldLocks[(index)].lockAddr)
|
#define LOCKDEP_GET_ADDR(lockDep, index) ((lockDep)->heldLocks[(index)].lockAddr)
|
||||||
|
|
||||||
@@ -107,6 +109,31 @@ WEAK VOID OsLockDepPanic(enum LockDepErrType errType)
|
|||||||
while (1) {}
|
while (1) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC VOID OsLockDepPrint(const CHAR *fmt, va_list ap)
|
||||||
|
{
|
||||||
|
UINT32 len;
|
||||||
|
CHAR buf[PRINT_BUF_SIZE] = {0};
|
||||||
|
|
||||||
|
len = vsnprintf_s(buf, PRINT_BUF_SIZE, PRINT_BUF_SIZE - 1, fmt, ap);
|
||||||
|
if ((len == -1) && (*buf == '\0')) {
|
||||||
|
/* parameter is illegal or some features in fmt dont support */
|
||||||
|
UartPuts("OsLockDepPrint is error\n", strlen("OsLockDepPrint is error\n") + 1, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
*(buf + len) = '\0';
|
||||||
|
|
||||||
|
UartPuts(buf, len, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC VOID OsPrintLockDepInfo(const CHAR *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, fmt);
|
||||||
|
OsLockDepPrint(fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
|
||||||
STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||||
const VOID *requestAddr, enum LockDepErrType errType)
|
const VOID *requestAddr, enum LockDepErrType errType)
|
||||||
{
|
{
|
||||||
@@ -114,24 +141,24 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
|||||||
const LockDep *lockDep = &task->lockDep;
|
const LockDep *lockDep = &task->lockDep;
|
||||||
const LosTaskCB *temp = task;
|
const LosTaskCB *temp = task;
|
||||||
|
|
||||||
PrintExcInfo("lockdep check failed\n");
|
OsPrintLockDepInfo("lockdep check failed\n");
|
||||||
PrintExcInfo("error type : %s\n", OsLockDepErrorStringGet(errType));
|
OsPrintLockDepInfo("error type : %s\n", OsLockDepErrorStringGet(errType));
|
||||||
PrintExcInfo("request addr : 0x%x\n", requestAddr);
|
OsPrintLockDepInfo("request addr : 0x%x\n", requestAddr);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
PrintExcInfo("task name : %s\n", temp->taskName);
|
OsPrintLockDepInfo("task name : %s\n", temp->taskName);
|
||||||
PrintExcInfo("task id : %u\n", temp->taskID);
|
OsPrintLockDepInfo("task id : %u\n", temp->taskID);
|
||||||
PrintExcInfo("cpu num : %u\n", temp->currCpu);
|
OsPrintLockDepInfo("cpu num : %u\n", temp->currCpu);
|
||||||
PrintExcInfo("start dumping lockdep infomation\n");
|
OsPrintLockDepInfo("start dumping lockdep infomation\n");
|
||||||
for (i = 0; i < lockDep->lockDepth; i++) {
|
for (i = 0; i < lockDep->lockDepth; i++) {
|
||||||
if (lockDep->heldLocks[i].lockPtr == lock) {
|
if (lockDep->heldLocks[i].lockPtr == lock) {
|
||||||
PrintExcInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
OsPrintLockDepInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
||||||
LOCKDEP_GET_ADDR(lockDep, i));
|
LOCKDEP_GET_ADDR(lockDep, i));
|
||||||
} else {
|
} else {
|
||||||
PrintExcInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i));
|
OsPrintLockDepInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PrintExcInfo("[%d] %s <-- now\n", i, lock->name);
|
OsPrintLockDepInfo("[%d] %s <-- now\n", i, lock->name);
|
||||||
|
|
||||||
if (errType == LOCKDEP_ERR_DEAD_LOCK) {
|
if (errType == LOCKDEP_ERR_DEAD_LOCK) {
|
||||||
temp = lock->owner;
|
temp = lock->owner;
|
||||||
@@ -144,7 +171,6 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OsLockDepPanic(errType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC BOOL OsLockDepCheckDependancy(const LosTaskCB *current, LosTaskCB *lockOwner)
|
STATIC BOOL OsLockDepCheckDependancy(const LosTaskCB *current, LosTaskCB *lockOwner)
|
||||||
@@ -172,7 +198,7 @@ VOID OsLockDepCheckIn(SPIN_LOCK_S *lock)
|
|||||||
{
|
{
|
||||||
UINT32 intSave;
|
UINT32 intSave;
|
||||||
enum LockDepErrType checkResult = LOCKDEP_SUCEESS;
|
enum LockDepErrType checkResult = LOCKDEP_SUCEESS;
|
||||||
VOID *requestAddr = (VOID *)__builtin_return_address(0);
|
VOID *requestAddr = (VOID *)__builtin_return_address(1);
|
||||||
LosTaskCB *current = OsCurrTaskGet();
|
LosTaskCB *current = OsCurrTaskGet();
|
||||||
LockDep *lockDep = ¤t->lockDep;
|
LockDep *lockDep = ¤t->lockDep;
|
||||||
LosTaskCB *lockOwner = NULL;
|
LosTaskCB *lockOwner = NULL;
|
||||||
@@ -211,11 +237,12 @@ OUT:
|
|||||||
lockDep->waitLock = lock;
|
lockDep->waitLock = lock;
|
||||||
lockDep->heldLocks[lockDep->lockDepth].lockAddr = requestAddr;
|
lockDep->heldLocks[lockDep->lockDepth].lockAddr = requestAddr;
|
||||||
lockDep->heldLocks[lockDep->lockDepth].waitTime = OsLockDepGetCycles(); /* start time */
|
lockDep->heldLocks[lockDep->lockDepth].waitTime = OsLockDepGetCycles(); /* start time */
|
||||||
} else {
|
OsLockDepRelease(intSave);
|
||||||
OsLockDepDumpLock(current, lock, requestAddr, checkResult);
|
return;
|
||||||
}
|
}
|
||||||
|
OsLockDepDumpLock(current, lock, requestAddr, checkResult);
|
||||||
OsLockDepRelease(intSave);
|
OsLockDepRelease(intSave);
|
||||||
|
OsLockDepPanic(checkResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID OsLockDepRecord(SPIN_LOCK_S *lock)
|
VOID OsLockDepRecord(SPIN_LOCK_S *lock)
|
||||||
@@ -253,7 +280,7 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
|||||||
UINT32 intSave;
|
UINT32 intSave;
|
||||||
INT32 depth;
|
INT32 depth;
|
||||||
enum LockDepErrType checkResult = LOCKDEP_SUCEESS;
|
enum LockDepErrType checkResult = LOCKDEP_SUCEESS;
|
||||||
VOID *requestAddr = (VOID *)__builtin_return_address(0);
|
VOID *requestAddr = (VOID *)__builtin_return_address(1);
|
||||||
LosTaskCB *current = OsCurrTaskGet();
|
LosTaskCB *current = OsCurrTaskGet();
|
||||||
LosTaskCB *owner = NULL;
|
LosTaskCB *owner = NULL;
|
||||||
LockDep *lockDep = NULL;
|
LockDep *lockDep = NULL;
|
||||||
@@ -265,7 +292,8 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
|||||||
if (owner == SPINLOCK_OWNER_INIT) {
|
if (owner == SPINLOCK_OWNER_INIT) {
|
||||||
checkResult = LOCKDEP_ERR_UNLOCK_WITOUT_LOCK;
|
checkResult = LOCKDEP_ERR_UNLOCK_WITOUT_LOCK;
|
||||||
OsLockDepDumpLock(current, lock, requestAddr, checkResult);
|
OsLockDepDumpLock(current, lock, requestAddr, checkResult);
|
||||||
goto OUT;
|
OsLockDepRelease(intSave);
|
||||||
|
OsLockDepPanic(checkResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
lockDep = &owner->lockDep;
|
lockDep = &owner->lockDep;
|
||||||
@@ -294,7 +322,6 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
|||||||
lock->cpuid = (UINT32)(-1);
|
lock->cpuid = (UINT32)(-1);
|
||||||
lock->owner = SPINLOCK_OWNER_INIT;
|
lock->owner = SPINLOCK_OWNER_INIT;
|
||||||
|
|
||||||
OUT:
|
|
||||||
OsLockDepRelease(intSave);
|
OsLockDepRelease(intSave);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ STATIC VOID ConsoleOutput(const CHAR *str, UINT32 len)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
cnt = write(STDOUT_FILENO, str + writen, (size_t)toWrite);
|
cnt = write(STDOUT_FILENO, str + writen, (size_t)toWrite);
|
||||||
if ((cnt < 0) || (toWrite == cnt)) {
|
if ((cnt < 0) || ((cnt == 0) && OS_INT_ACTIVE) || (toWrite == cnt)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
writen += cnt;
|
writen += cnt;
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ STATIC INT32 GetArgs(CHAR **args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LOSCFG_STORAGE_EMMC
|
#ifdef LOSCFG_STORAGE_EMMC
|
||||||
|
(void)DiskEventRead();
|
||||||
g_emmcDisk = GetMmcDisk(EMMC);
|
g_emmcDisk = GetMmcDisk(EMMC);
|
||||||
if (g_emmcDisk == NULL) {
|
if (g_emmcDisk == NULL) {
|
||||||
PRINT_ERR("Get EMMC disk failed!\n");
|
PRINT_ERR("Get EMMC disk failed!\n");
|
||||||
|
|||||||
@@ -157,6 +157,12 @@ INT32 OsShellDeinit(INT32 consoleId)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(LOSCFG_PLATFORM_ROOTFS)
|
||||||
|
if (consoleId == CONSOLE_SERIAL){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
(VOID)LOS_TaskDelete(shellCB->shellEntryHandle);
|
(VOID)LOS_TaskDelete(shellCB->shellEntryHandle);
|
||||||
(VOID)LOS_EventWrite(&shellCB->shellEvent, CONSOLE_SHELL_KEY_EVENT);
|
(VOID)LOS_EventWrite(&shellCB->shellEvent, CONSOLE_SHELL_KEY_EVENT);
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
+16
-10
@@ -108,7 +108,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct itimerval svalue;
|
struct itimerval svalue;
|
||||||
struct itimerval sovalue;
|
struct itimerval sovalue = { 0 };
|
||||||
|
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -136,7 +136,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
|
|||||||
int SysGetiTimer(int which, struct itimerval *value)
|
int SysGetiTimer(int which, struct itimerval *value)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct itimerval svalue;
|
struct itimerval svalue = { 0 };
|
||||||
|
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -188,7 +188,7 @@ int SysTimerCreate(clockid_t clockID, struct sigevent *evp, timer_t *timerID)
|
|||||||
int SysTimerGettime(timer_t timerID, struct itimerspec *value)
|
int SysTimerGettime(timer_t timerID, struct itimerspec *value)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct itimerspec svalue;
|
struct itimerspec svalue = { 0 };
|
||||||
|
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -212,7 +212,7 @@ int SysTimerSettime(timer_t timerID, int flags, const struct itimerspec *value,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct itimerspec svalue;
|
struct itimerspec svalue;
|
||||||
struct itimerspec soldValue;
|
struct itimerspec soldValue = { 0 };
|
||||||
|
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -284,7 +284,7 @@ int SysClockSettime(clockid_t clockID, const struct timespec *tp)
|
|||||||
int SysClockGettime(clockid_t clockID, struct timespec *tp)
|
int SysClockGettime(clockid_t clockID, struct timespec *tp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct timespec stp;
|
struct timespec stp = { 0 };
|
||||||
|
|
||||||
if (tp == NULL) {
|
if (tp == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -307,7 +307,7 @@ int SysClockGettime(clockid_t clockID, struct timespec *tp)
|
|||||||
int SysClockGetres(clockid_t clockID, struct timespec *tp)
|
int SysClockGetres(clockid_t clockID, struct timespec *tp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct timespec stp;
|
struct timespec stp = { 0 };
|
||||||
|
|
||||||
if (tp == NULL) {
|
if (tp == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -362,6 +362,11 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rmtp && LOS_ArchCopyFromUser(&srmtp, rmtp, sizeof(struct timespec))) {
|
||||||
|
errno = EFAULT;
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
ret = nanosleep(&srqtp, rmtp ? &srmtp : NULL);
|
ret = nanosleep(&srqtp, rmtp ? &srmtp : NULL);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return -get_errno();
|
return -get_errno();
|
||||||
@@ -378,7 +383,7 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
|
|||||||
clock_t SysTimes(struct tms *buf)
|
clock_t SysTimes(struct tms *buf)
|
||||||
{
|
{
|
||||||
clock_t ret;
|
clock_t ret;
|
||||||
struct tms sbuf;
|
struct tms sbuf = { 0 };
|
||||||
|
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
errno = EFAULT;
|
errno = EFAULT;
|
||||||
@@ -430,7 +435,7 @@ int SysClockGettime64(clockid_t clockID, struct timespec64 *tp)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct timespec t;
|
struct timespec t;
|
||||||
struct timespec64 stp;
|
struct timespec64 stp = { 0 };
|
||||||
|
|
||||||
if (tp == NULL) {
|
if (tp == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -457,7 +462,7 @@ int SysClockGetres64(clockid_t clockID, struct timespec64 *tp)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct timespec t;
|
struct timespec t;
|
||||||
struct timespec64 stp;
|
struct timespec64 stp = { 0 };
|
||||||
|
|
||||||
if (tp == NULL) {
|
if (tp == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -519,7 +524,7 @@ int SysTimerGettime64(timer_t timerID, struct itimerspec64 *value)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct itimerspec val;
|
struct itimerspec val;
|
||||||
struct itimerspec64 svalue;
|
struct itimerspec64 svalue = { 0 };
|
||||||
|
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@@ -578,6 +583,7 @@ int SysTimerSettime64(timer_t timerID, int flags, const struct itimerspec64 *val
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oldValue != NULL) {
|
if (oldValue != NULL) {
|
||||||
|
(void)memset_s(&soldValue, sizeof(struct itimerspec64), 0, sizeof(struct itimerspec64));
|
||||||
soldValue.it_interval.tv_sec = oldVal.it_interval.tv_sec;
|
soldValue.it_interval.tv_sec = oldVal.it_interval.tv_sec;
|
||||||
soldValue.it_interval.tv_nsec = oldVal.it_interval.tv_nsec;
|
soldValue.it_interval.tv_nsec = oldVal.it_interval.tv_nsec;
|
||||||
soldValue.it_value.tv_sec = oldVal.it_value.tv_sec;
|
soldValue.it_value.tv_sec = oldVal.it_value.tv_sec;
|
||||||
|
|||||||
Reference in New Issue
Block a user