---
name: "libalpm_misc"
section: "3"
platform: "linux"
package: "pacman"
version: "7.1.0.r9.g54d9411-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libalpm_misc"
---

# libalpm\_misc(3)

Miscellaneous Functions - Various libalpm functions

## NAME

libalpm\_misc - Miscellaneous Functions

 \- Various libalpm functions

## SYNOPSIS

### Typedefs

typedef int64\_t **alpm\_time\_t**\
 The time type used by libalpm.

### Enumerations

enum **alpm\_caps** { **ALPM\_CAPABILITY\_NLS** = (1 \<\< 0), **ALPM\_CAPABILITY\_DOWNLOADER** = (1 \<\< 1), **ALPM\_CAPABILITY\_SIGNATURES** = (1 \<\< 2) }\
 Enum of possible compile time features.

### Functions

**alpm\_pkg\_t** \* **alpm\_sync\_get\_new\_version** (**alpm\_pkg\_t** \*pkg, **alpm\_list\_t** \*dbs\_sync)\
 Check for new version of pkg in syncdbs.  char \* **alpm\_compute\_md5sum** (const char \*filename)\
 Get the md5 sum of file.  char \* **alpm\_compute\_sha256sum** (const char \*filename)\
 Get the sha256 sum of file.  int **alpm\_unlock** (**alpm\_handle\_t** \*handle)\
 Remove the database lock file.  const char \* **alpm\_version** (void)\
 Get the version of library.  int **alpm\_capabilities** (void)\
 Get the capabilities of the library.  int **alpm\_sandbox\_setup\_child** (**alpm\_handle\_t** \*handle, const char \*sandboxuser, const char \*sandbox\_path, bool restrict\_syscalls)\
 Drop privileges by switching to a different user.

## Detailed Description

Various libalpm functions

## Typedef Documentation

### typedef int64\_t alpm\_time\_t

The time type used by libalpm. Represents a unix time stamp

## Enumeration Type Documentation

### enum alpm\_caps

Enum of possible compile time features.

**Enumerator**

- ***ALPM\_CAPABILITY\_NLS***

  localization

- ***ALPM\_CAPABILITY\_DOWNLOADER***

  Ability to download.

- ***ALPM\_CAPABILITY\_SIGNATURES***

  Signature checking.

## Function Documentation

### int alpm\_capabilities (void )

Get the capabilities of the library.

**Returns**

a bitmask of the capabilities

References **alpm\_capabilities()**.

Referenced by **alpm\_capabilities()**.

### char \* alpm\_compute\_md5sum (const char \* filename)

Get the md5 sum of file.

**Parameters**

*filename* name of the file

**Returns**

the checksum on success, NULL on error

References **alpm\_compute\_md5sum()**.

Referenced by **alpm\_compute\_md5sum()**.

### char \* alpm\_compute\_sha256sum (const char \* filename)

Get the sha256 sum of file.

**Parameters**

*filename* name of the file

**Returns**

the checksum on success, NULL on error

References **alpm\_compute\_sha256sum()**.

Referenced by **alpm\_compute\_sha256sum()**.

### int alpm\_sandbox\_setup\_child (alpm\_handle\_t \* handle, const char \* sandboxuser, const char \* sandbox\_path, bool restrict\_syscalls)

Drop privileges by switching to a different user.

**Parameters**

*handle* the context handle \
 *sandboxuser* the user to switch to \
 *sandbox\_path* if non-NULL, restrict writes to this filesystem path \
 *restrict\_syscalls* whether to deny access to a list of dangerous syscalls

**Returns**

0 on success, -1 on failure

References **alpm\_sandbox\_setup\_child()**.

Referenced by **alpm\_sandbox\_setup\_child()**.

### alpm\_pkg\_t \* alpm\_sync\_get\_new\_version (alpm\_pkg\_t \* pkg, alpm\_list\_t \* dbs\_sync)

Check for new version of pkg in syncdbs. If the same package appears multiple dbs only the first will be checked

This only checks the syncdb for a newer version. It does not access the network at all. See **alpm\_db\_update** to update a database.

References **alpm\_sync\_get\_new\_version()**.

Referenced by **alpm\_sync\_get\_new\_version()**.

### int alpm\_unlock (alpm\_handle\_t \* handle)

Remove the database lock file.

**Parameters**

*handle* the context handle

**Returns**

0 on success, -1 on error

**Note**

Safe to call from inside signal handlers.

References **alpm\_unlock()**.

Referenced by **alpm\_unlock()**.

### const char \* alpm\_version (void )

Get the version of library.

**Returns**

the library version, e.g. "6.0.4"

References **alpm\_version()**.

Referenced by **alpm\_version()**.

## Author

Generated automatically by Doxygen for libalpm from the source code.
