I have no idea what you're even trying to do with that enum. Usually you'd make an enum like enum { TITLE1=3, TITLE2=5, TITLE3=99 }; so that when you use TITLE1 in your code it becomes the number 3, and so forth. Their values are fixed at compile time, just like a #define and such.
I think you mean 'sparse array', not 'spare array'.
The C language's features closely match the CPU's features, so complex data types like sparse arrays aren't directly supported. You can make them, though. Here's a quick-and-simple one which works as a simple list like you wanted. Not the most efficient if you want it to hold thousands of numbers, but for a few dozen, should be fine...
Last edited by Corona688; 09-07-2012 at 03:44 PM..
Hi, guys !
Could someone clarify one thing for me:
I start machine from disk0, and want to check the /etc/vfstab on disk1. How do i do it ?
Tried to write:
cd /
mount /dev/dsk/c0t1d0s0 /mnt
But if I do cd /mnt, it is empty. I expected to see disk1 there ? Or am I wrong ?
How do I... (3 Replies)
helo i have asked in exam what that what is the base type of
enum
options are given bewlo
(1) long int
(2) short int
(3) signed int
(4) unsigned int
can u tell me what is the exact answer from the above option
Regards,
Amit (1 Reply)
Hi Guys,
This is really really urgent. Am looking out for some quick answers.
I'm developing a DNS Resolver client that interprets DNS Query repsonses & pass on the needful to DNS applications.
When an ENUM query(modified to an nslookup naptr query) is issued & an NAPTR RR(Resource Record)... (1 Reply)
One more query in SVM :) Now with hot spare spool...
I can understand adding/replacing a slice in particular hot spare pool with "-a / -r" option (or) adding a slice to all existing hot spare pool with "-all" option. Here my query is for deleting, we have only option "-d".
1) If the hot... (2 Replies)
Hi Guys,
Can Someone pls let me know the thorough process for Hot spare replacement
as current Hot spare slice has broken down . :mad:
Thanks
---------- Post updated at 06:34 PM ---------- Previous update was at 05:21 PM ----------
Update : Its a solaris 10 box (1 Reply)
Say I have a list of enumerations I wish to use to select a variable at compile-time:
enum pins
{
PIN_A=1,
PIN_B=7,
PIN_C=6,
}
int VAR1, VAR2, VAR3, VAR4, VAR5, VAR6, VAR7;
#define PIN_TO_VAR(NUM) VAR ## NUM
int main(void)
{
PIN_TO_VAR(PIN_A)=32;... (2 Replies)
Dears how can i make this spare disks working online to replace a defective disks
vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0t10d0s2 sliced - - error
c0t11d0s2 sliced disk08 rootdg online
c1t16d0s2 sliced ... (3 Replies)
Hi All,
I came across this error "MIXING ENUM TYPES" when I run my C program against the Coverity Tool. I've made many search relating to the error, but I didnt find the exact solution. Can anyone help me to overcome this.?
Thanks in Advance.!! (3 Replies)
Hi Guys,
obviously new to SOLARIS SUN SPARC 5.10
I would really appreciate if you help me see how to find free disks available in my system.
Like i am a linux admin. If i want to grow a file system in linux. I would first have a look at my volume groups to see if they have free PEs if not then... (2 Replies)
Discussion started by: aiqbal
2 Replies
LEARN ABOUT HPUX
psradm
psradm(1M) System Administration Commands psradm(1M)NAME
psradm - change processor operational status
SYNOPSIS
psradm -f | -i | -n | -s [-v] [-F] processor_id
psradm -a -f | -i | -n | -s [-v] [-F]
DESCRIPTION
The psradm utility changes the operational status of processors. The legal states for the processor are on-line, off-line, spare, faulted,
and no-intr.
An on-line processor processes LWPs (lightweight processes) and can be interrupted by I/O devices in the system.
An off-line processor does not process any LWPs. Usually, an off-line processor is not interruptible by I/O devices in the system. On some
processors or under certain conditions, it might not be possible to disable interrupts for an off-line processor. Thus, the actual effect
of being off-line might vary from machine to machine.
A spare processor does not process any LWPs. A spare processor can be brought on-line, off-line or to no-intr by a privileged user of the
system or by the kernel in response to changes in the system state.
A faulted processor is identified by the kernel, which monitors the behavior of processors over time. A privileged user can set the state
of a faulted processor to be on-line, off-line, spare or no-intr, but must use the force option to do so.
A no-intr processor processes LWPs but is not interruptible by I/O devices.
A processor can not be taken off-line or made spare if there are LWPs that are bound to the processor unless the additional -F option is
used. The -F option removes processor bindings of such LWPs before changing the processor's operational status. On some architectures, it
might not be possible to take certain processors off-line or spare if, for example, the system depends on some resource provided by the
processor.
At least one processor in the system must be able to process LWPs. At least one processor must also be able to be interrupted. Since an
off-line or spare processor can be interruptible, it is possible to have an operational system with one processor no-intr and all other
processors off-line or spare but with one or more accepting interrupts.
If any of the specified processors are powered off, psradm might power on one or more processors.
Only superusers can use the psradm utility.
OPTIONS
The following options are supported:
-a Perform the action on all processors, or as many as possible.
-f Take the specified processors off-line.
-F Force the transition to the additional specified state. Required if one or more of the specified processors was in the faulted
state. Set the specified processors to faulted, if no other transition option was specified. Forced transitions can only be made
to faulted, spare, or off-line states. Administrators are encouraged to use the -Q option for pbind(1M) to find out which threads
will be affected by forced a processor state transition.
-i Set the specified processors no-intr.
-n Bring the specified processors on-line.
-s Make the specified processors spare.
-v Output a message giving the results of each attempted operation.
OPERANDS
The following operands are supported:
processor_id The processor ID of the processor to be set on-line or off-line, spare, or no-intr.
Specify processor_id as an individual processor number (for example, 3), multiple processor numbers separated by spaces
(for example, 1 2 3), or a range of processor numbers (for example, 1-4). It is also possible to combine ranges and (indi-
vidual or multiple) processor_ids (for example, 1-3 5 7-8 9).
EXAMPLES
Example 1: Setting Processors to off-line
The following example sets processors 2 and 3 off-line:
% psradm -f 2 3
Example 2: Setting Processors to no-intr
The following example sets processors 1 and 2 no-intr:
% psradm -i 1 2
Example 3: Setting Processors to spare
The following example sets processors 1 and 2 spare, even if either of the processors was in the faulted state:
% psradm -F -s 1 2
Example 4: Setting All Processors on-line
% psradm -a -n
Example 5: Forcing Processors to off-line
The following example sets processors 1 and 2 offline, and revokes the processor bindings from the processes bound to them:
% psradm -F -f 1 2
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
FILES
/etc/wtmpx Records logging processor status changes
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO pbind(1M), psrinfo(1M), psrset(1M), p_online(2), processor_bind(2), attributes(5)DIAGNOSTICS
psradm: processor 4: Invalid argument
The specified processor does not exist in the configuration.
psradm: processor 3: Device busy
The specified processor could not be taken off-line because it either has LWPs bound to it, is the last on-line processor in the sys-
tem, or is needed by the system because it provides some essential service.
psradm: processor 3: Device busy
The specified processor could not be set no-intr because it is the last interruptible processor in the system, or or it is the only
processor in the system that can service interrupts needed by the system.
psradm: processor 3: Device busy
The specified processor is powered off, and it cannot be powered on because some platform-specific resource is unavailable.
psradm: processor 0: Not owner
The user does not have permission to change processor status.
psradm: processor 2: Operation not supported
The specified processor is powered off, and the platform does not support power on of individual processors.
SunOS 5.10 17 Aug 2004 psradm(1M)