---
name: "os_version"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/os_version"
---

# os\_version(3alleg)

Version of the OS currently running. Allegro game programming library.

## NAME

os\_version, os\_revision - Version of the OS currently running. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**extern int os\_version;**

**extern int os\_revision;**

## DESCRIPTION

The major and minor version of the Operating System currently running. Set by allegro\_init(). If Allegro for some reason was not able to retrieve the version of the Operating System, os\_version and os\_revision will be set to -1. For example: Under Win98 SE (v4.10.2222) os\_version will be set to 4 and os\_revision to 10.

## SEE ALSO

[**os\_type**(3alleg)](/os_type/3alleg.md), [**os\_multitasking**(3alleg)](/os_multitasking/3alleg.md)
