⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smfixblkshow.c

📁 vxworks源码源码解读是学习vxworks的最佳途径
💻 C
字号:
/* smFixBlkShow.c - fixed block shared memory manager show utility *//* Copyright 1984-1992 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01c,29jan93,pme  added little endian support01b,02oct92,pme  added SPARC support.01a,19jul92,pme  written.*//*DESCRIPTIONThis library provides routines to show current status and statisticsfor the fixed block shared memory manager.INCLUDE FILE: private/smFixBlkLibP.hSEE ALSO: smFixBlkLib smObjLib*//* includes */#include "vxWorks.h"#include "smObjLib.h"#include "smLib.h"#include "smMemLib.h"#include "stdlib.h"#include "stdio.h"#include "string.h"#include "errno.h"#include "netinet/in.h"#include "private/smFixBlkLibP.h"/********************************************************************************* smFixBlkPartShow - show fixed block shared partition statistics** For a specified fixed block shared partition, this routine displays the total * number of blocks in the partition and the block size. It also shows * the number of blocks currently allocated, and the cumulative number of* allocated blocks.** <gPartId> is the global (system wide) identifier of the partition to * use. Its value is the global address of the partition structure. ** WARNING: This routine does not get exclusive access to the partition *          to display its status.** RETURNS: OK or ERROR.** ERRNO:**   S_smMemLib_INVALID_PART_ID** NOMANUAL*/STATUS smFixBlkPartShow     (    SM_FIX_BLK_PART_ID gPartId  /* global partition id to use */    )    {    SM_FIX_BLK_PART_ID partId;  /* local address of partition */    partId = (SM_FIX_BLK_PART_ID) GLOB_TO_LOC_ADRS (gPartId);    if (partId == LOC_NULL)	{	printf ("No partId specified.\n");	return (ERROR);	}    if (SM_OBJ_VERIFY (partId) != OK)        return (ERROR);    /* now print the statistics without locking access to partition */    printf ("\nBlock size                  : %d bytes  \n", 	    ntohl (partId->blockSize));    printf ("Allocated blocks            : max : %d current : %d free : %d\n", 	     ntohl (partId->totalBlocks),	     ntohl (partId->curBlocksAllocated),	     (ntohl(partId->totalBlocks) - ntohl(partId->curBlocksAllocated)));    printf ("Cumulative allocated blocks : %d\n", 	    ntohl (partId->cumBlocksAllocated));    return (OK);    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -