66 for ( i = 0 ; i <
len ; i++ )
68 for ( i = 0 ; i <
len ; i++ )
70 for ( i = 0 ; i <
len ; i++ )
83 unsigned long last_check;
84 unsigned long last_progress;
85 unsigned long last_display;
87 unsigned long elapsed;
89 unsigned long scaled_completed;
90 unsigned long scaled_total;
91 unsigned int percentage;
98 printf (
"%s...",
string );
100 last_check = last_progress = last_display =
currticks();
110 elapsed = ( now - last_check );
133 elapsed = ( now - last_progress );
140 elapsed = ( now - last_display );
144 scaled_completed = ( progress.
completed / 128 );
145 scaled_total = ( progress.
total / 128 );
146 if ( scaled_total ) {
147 percentage = ( ( 100 * scaled_completed ) /
149 clear_len =
printf (
"%3d%%", percentage );
155 clear_len +=
printf (
" [%s]",
An object interface operation.
struct arbelprm_rc_send_wqe rc
void intf_close(struct interface *intf, int rc)
Close an object interface.
void intf_restart(struct interface *intf, int rc)
Shut down and restart an object interface.
static struct interface_descriptor monojob_intf_desc
#define TICKS_PER_SEC
Number of ticks per second.
int printf(const char *fmt,...)
Write a formatted string to the console.
int monojob_wait(const char *string, unsigned long timeout)
Wait for single foreground job to complete.
#define INTF_INIT(descriptor)
Initialise a static object interface.
#define INTF_DESC_PURE(operations)
Define an object interface descriptor for a pure-interface object.
#define ECANCELED
Operation canceled.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned long total
Total operation size.
unsigned long completed
Amount of operation completed so far.
static struct interface_operation monojob_intf_op[]
#define EINPROGRESS
Operation in progress.
An object interface descriptor.
int getchar(void)
Read a single character from any console.
char * strerror(int errno)
Retrieve string representation of error number.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
static void monojob_close(struct interface *intf, int rc)
char message[32]
Message (optional)
void step(void)
Single-step a single process.
int job_progress(struct interface *intf, struct job_progress *progress)
Get job progress.
static void monojob_clear(size_t len)
Clear previously displayed message.
unsigned long currticks(void)
Get current system time in ticks.
int putchar(int character)
Write a single character to each console device.
#define ETIMEDOUT
Connection timed out.
int iskey(void)
Check for available input on any console.