コード例 #1
0
ファイル: labels.c プロジェクト: AlphaStaxLLC/libguestfs
int
do_set_label (const mountable_t *mountable, const char *label)
{
  int r;

  /* How we set the label depends on the filesystem type. */
  CLEANUP_FREE char *vfs_type = do_vfs_type (mountable);
  if (vfs_type == NULL)
    return -1;

  if (STREQ (vfs_type, "btrfs"))
    r = btrfs_set_label (mountable->device, label);

  else if (STREQ (vfs_type, "msdos") ||
           STREQ (vfs_type, "fat") ||
           STREQ (vfs_type, "vfat"))
    r = dosfslabel (mountable->device, label);

  else if (fstype_is_extfs (vfs_type))
    r = do_set_e2label (mountable->device, label);

  else if (STREQ (vfs_type, "ntfs"))
    r = ntfs_set_label (mountable->device, label);

  else if (STREQ (vfs_type, "xfs"))
    r = xfslabel (mountable->device, label);

  else
    NOT_SUPPORTED (-1, "don't know how to set the label for '%s' filesystems",
                   vfs_type);

  return r;
}
コード例 #2
0
ファイル: launch.c プロジェクト: pioto/libguestfs
/* Maximum number of disks. */
int
guestfs__max_disks (guestfs_h *g)
{
  if (g->backend_ops->max_disks == NULL)
    NOT_SUPPORTED (g, -1,
                   _("the current backend does not allow max disks to be queried"));

  return g->backend_ops->max_disks (g, g->backend_data);
}
コード例 #3
0
ファイル: launch.c プロジェクト: pioto/libguestfs
int
guestfs__get_pid (guestfs_h *g)
{
  if (g->state != READY || g->backend_ops == NULL) {
    error (g, _("get-pid can only be called after launch"));
    return -1;
  }

  if (g->backend_ops->get_pid == NULL)
    NOT_SUPPORTED (g, -1,
                   _("the current backend does not support 'get-pid'"));

  return g->backend_ops->get_pid (g, g->backend_data);
}
コード例 #4
0
ファイル: thread_arch.c プロジェクト: A-Paul/RIOT
void  thread_stack_print(void)
{
    /* Print the current stack to stdout. */

    #if defined(DEVELHELP)
    volatile thread_t* task = thread_get(sched_active_pid);
    if (task) {

        char* stack_top = task->stack_start + task->stack_size;
        int   size = stack_top - task->sp;
        printf("Printing current stack of thread %" PRIkernel_pid "\n", thread_getpid());
        esp_hexdump((void*)(task->sp), size >> 2, 'w', 8);
    }
    #else
    NOT_SUPPORTED();
    #endif
}
コード例 #5
0
ファイル: cam_functions.c プロジェクト: LucyScott/mdsplus
//-----------------------------------------------------------
static int MultiIo(
					CamKey			Key,
					BYTE			A,
					BYTE			F,
					int				Count,
					BYTE			*Data,
					BYTE			Mem,
					TranslatedIosb	*iosb,
					int				dmode,
					int				Enhanced
					)
{
	char	tmp[7];
	int		highwayType, mode, status;

	if( MSGLVL(FUNCTION_NAME) )
		printf( "\033[01;31mMultiIo(F=%d, count=%d)-->>\033[0m\n", F, Count );
	sprintf(tmp, "GK%c%d", Key.scsi_port, Key.scsi_address);

	if( (status = QueryHighwayType( tmp )) == SUCCESS ) {
		highwayType = NUMERIC(tmp[5]);				// extract type

		switch( highwayType ) {						// check highway type
			case JORWAY:
			case JORWAY_OLD:
				if( MSGLVL(DETAILS) )
					printf( "-->>JorwayDoIo()\n" );

				mode = JORWAYMODE(dmode, (Enhanced && highwayType == JORWAY), Count > 1);
				if( mode != NO_MODE )
					status = JorwayDoIo(
									Key, 			// module info
									A, 				// module sub address
									F, 				// module function
									Count,			// data count int bytes
									Data, 			// data
									Mem, 			// 16 or 24 bit data
									iosb,			// status struct
									dmode,			// mode
									Enhanced		// highway mode
									);
				else
					status = NOT_SUPPORTED();

				break;

			case KINSYSCO:
				if( MSGLVL(DETAILS) )
					printf( "-->>KsMultiIo()\n" );

				status = KsMultiIo(
									Key,			// module info
									A,				// module sub-address
									F,				// module function
									Count,			// data count in bytes
									Data,			// data
									Mem,			// 16 or 24 bit data
									iosb,			// status struct
									KSMODE(dmode),	// mode
									Enhanced		// enhanced
									);
				break;

		        case JORWAY_73A:

				mode = JORWAYMODE(dmode, (Enhanced && highwayType == JORWAY), Count > 1);
				if( mode != NO_MODE )
					status = Jorway73ADoIo(
									Key, 			// module info
									A, 				// module sub address
									F, 				// module function
									Count,			// data count int bytes
									Data, 			// data
									Mem, 			// 16 or 24 bit data
									iosb,			// status struct
									dmode,			// mode
									Enhanced		// highway mode
									);
				else
					status = NOT_SUPPORTED();

				break;

			default:
				if( MSGLVL(IMPORTANT) )
					fprintf( stderr, "highway type(%d) not supported\n", highwayType );

				status = FAILURE;
				break;
		} // end of switch()
	} // end of if()

    if( MSGLVL(DETAILS) ) {
	  if (!iosb) printf("MultiIo null iosb ptr"); else
     printf("MultiIo(iosb)::->> bytecount= %d\n", iosb->bytcnt);  // [2002.12.13]
	}
	return status;
}