Changeset f35749e in mainline for uspace/lib/system/src/system.c


Ignore:
Timestamp:
2025-02-28T23:38:26Z (4 days ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
8300c72
Parents:
4285f384
Message:

System restart via shutdown -r

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/system/src/system.c

    r4285f384 rf35749e  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    141141}
    142142
    143 /** Shut the system down.
     143/** Shut down and power the system off.
    144144 *
    145145 * This function is asynchronous. It returns immediately with success
     
    151151 * @return EOK on succes or an error code
    152152 */
    153 errno_t system_shutdown(system_t *system)
     153errno_t system_poweroff(system_t *system)
    154154{
    155155        async_exch_t *exch = async_exchange_begin(system->sess);
    156         errno_t rc = async_req_0_0(exch, SYSTEM_SHUTDOWN);
     156        errno_t rc = async_req_0_0(exch, SYSTEM_POWEROFF);
     157        async_exchange_end(exch);
     158
     159        return rc;
     160}
     161
     162/** Shut down and restart the system.
     163 *
     164 * This function is asynchronous. It returns immediately with success
     165 * if the system started shutting down. Once shutdown is completed,
     166 * the @c shutdown_complete callback is executed. If the shutdown fails,
     167 * the @c shutdown_fail callback is executed.
     168 *
     169 * @param system System control service
     170 * @return EOK on succes or an error code
     171 */
     172errno_t system_restart(system_t *system)
     173{
     174        async_exch_t *exch = async_exchange_begin(system->sess);
     175        errno_t rc = async_req_0_0(exch, SYSTEM_RESTART);
    157176        async_exchange_end(exch);
    158177
Note: See TracChangeset for help on using the changeset viewer.