Skip to content

Commit

Permalink
Improve performance and code style, refactor, partial rewrite (#17)
Browse files Browse the repository at this point in the history
* Improve readability (uniformity, naming, includes)

* De-cluttering, new types, reduced usage of globals

* Introduce new enums, change format functions

* Change to realtime clock

* Improve performance and style, partial rewrite

This commit addresses TODO#2 by universalizing the functions handling
the zombie processes and sending `SIGCHLD` in the case where the
user did not explicitly tell the program to reap zombies (reflected
in the `terminate` member of our settings. Whenever a signal
is sent, the used signal is displayed to the user.

Some parts of old functions were put into new functions to also
improve readability.

The most substantial improvement lies in the performance aspect
of the program. The use of `nftw()` in the old code was the
biggest bottleneck, as an insane, unnecessary number of syscall
are issued for each process. Thus, the directory and file reading
part was adapted, using manual `readdir()` calls. As the `-f` flag
did not make sense to have in the program anyway (and could lead
to OOM kill), it was also dropped.

Regex was also dropped, as its use was unnecessary and complicated
things, and the parsing of `"/proc/<pid>/stat"` was rewritten.

As kernel processes were not excluded in the program before,
this commit checks for processes which should be left out
of our considerations (PID `2`, as well as its children;
`init` is also excluded).

Display widths for the output are now defined in the accompanying
header, and should be in line with the `proc(5)` documentation.

The code for the prompt was improved with respect to the handling
of invalid user input and coloring.

Finally, to completely remove the unnecessary globals, a vector
structure was defined in the header, which can dynamically grow.
As the old version of the code did not check for overflows in this
context, this is also a great improvement.

* Add newline at end of file in Dockerfile

* Adapt code in `zproc.c` to match `zps.{c,h}`

* Update manpage to match source

* Remove the `-f` flag test

* Remove unnecessary comments and update category

* Add missing newline at EOF in `CMakeLists.txt`

* Remove notions of `-f` from the READMEs

* Add a `.clang-format` file consistent with sources

* Remove the other `-f` test

* Add missing `<limits.h>` include

* Use custom signal abbreviation function

* Remove `stdlib.h.gcov` from `rm` command

* Change array to `static`

* Remove redundant print (will never happen (`proc(5)`)

* Add `const` qualifiers to be more clear

* Add even more `const` qualifiers

* Change function pre-conditions to `assert()` calls

* Bump version

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>

* Drop unused macro

* Define `NDEBUG` in `CMakeLists.txt` and `Makefile`

This will disable the pre-condition assertions in all functions,
which should never be false for releases anyway.

* Extend color functionality, refactor CLI options

This commit ...

* allows users to directly specify signals to
send to zombie parents (using common signal
numbers, abbreviations and abbreviations with
"sig" in front of them (case-insensitive)

* changes existing command-line options to simpler
ones

* places constraints on the possible combinations
of command-line options used

* adds functionality to detect if the program's
output is, for example, piped to another program
that will automatically disable ANSI color codes

* adds a `--no-color` option to manually disable
the default coloring

The manual page and READMEs would still need
to be updated.

* Update tested flags

* Update demos, READMEs and help texts

* Bump year

* Improve code clarity and remove TODOs (issues TBA)

* Disable runtime assertions for the `Dockerfile`

---------

Co-authored-by: Matthäus Wininger <matthaeus dot wininger at univie dot ac dot at>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
  • Loading branch information
mforthewin and orhun committed Jan 19, 2024
1 parent f15cd84 commit 76ffe80
Show file tree
Hide file tree
Showing 18 changed files with 1,162 additions and 512 deletions.
20 changes: 2 additions & 18 deletions .application/zps.desktop
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
[Desktop Entry]

# Type
Type=Application

# The name of the application
Name=zps

# Application comment
Comment=A small utility for listing and reaping zombie processes.

# The executable of the application
Exec=zps

# Name of the icon
Icon=utilities-system-monitor

# Run in terminal
Terminal=true

# Categories
Categories=Utility;ConsoleOnly;Monitor;

# Don't display zps in the menus
NoDisplay=true
Categories=System;Monitor;ConsoleOnly;
NoDisplay=true
107 changes: 107 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptForEachMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
...
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ project(zps C)
# Target
set(TARGET "zps")
# Add project source
add_executable(${TARGET} src/${TARGET}.c src/${TARGET}.h)
add_executable(${TARGET})
target_sources(${TARGET} PRIVATE src/${TARGET}.c src/${TARGET}.h)
# Compile options
target_compile_options(${TARGET} PRIVATE -s -O3 -Wall -Wextra -pedantic)
target_compile_definitions(${TARGET} PRIVATE NDEBUG)
# Install
install(TARGETS ${TARGET} RUNTIME DESTINATION bin)
install(TARGETS ${TARGET} RUNTIME DESTINATION bin)
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project and compiler information
NAME := zps
CFLAGS := -s -O3 -Wall -Wextra -pedantic
CFLAGS := -s -O3 -Wall -Wextra -pedantic -DNDEBUG
ifeq ($(CC),)
CC := gcc
endif
Expand Down
55 changes: 29 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### A small utility for listing and reaping zombie processes on GNU/Linux.

![zps](https://user-images.githubusercontent.com/24392180/66898210-64e6ed80-f001-11e9-8e27-0ab3a7cabdca.gif)
![zps](assets/demo-top.gif)

[![Build](https://img.shields.io/github/actions/workflow/status/orhun/zps/ci.yml?color=black&style=flat-square)](https://github.com/orhun/zps/actions?query=workflow%3A%22Continuous+Integration%22)
[![Docker Build](https://img.shields.io/github/actions/workflow/status/orhun/zps/docker.yml?color=black&style=flat-square&label=docker)](https://github.com/orhun/zps/actions?query=workflow%3A%22Docker+Automated+Builds%22)
Expand All @@ -24,7 +24,7 @@ Zombie processes are not harmful since they are not affecting other processes or
cd example/ && gcc -O3 -Wall zproc.c -o zproc && ./zproc
```

**zps** aims to list the running processes at a particular time with stats and indicate the zombie processes on this list. It can also reap these zombie processes automatically if `--reap` argument is provided. There's also `--lreap` argument for reaping zombie processes after listing. See [usage](https://github.com/orhun/zps#usage) for more information.
**zps** aims to list the running processes at a particular time with stats and indicate the zombie processes on this list. It can also reap these zombie processes automatically based on the arguments provided (by default using `SIGTERM`). See [usage](https://github.com/orhun/zps#usage) for more information.
Technically, **zps** reads process stats from [/proc](https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html) filesystem and uses [C POSIX library](https://en.wikipedia.org/wiki/C_POSIX_library) to handle listing, sending signals and other operations.

<details>
Expand All @@ -43,10 +43,11 @@ Technically, **zps** reads process stats from [/proc](https://www.tldp.org/LDP/L
- [Building an image](#building-an-image)
- [Running the image in container](#running-the-image-in-container)
- [Usage](#usage)
- [zps -r](#zps--r)
- [zps -x](#zps--x)
- [zps -l](#zps--l)
- [zps -p](#zps--p)
- [zps -r](#zps--r--reap)
- [zps -s](#zps--s--signal)
- [zps -p](#zps--p--prompt)
- [zps -q](#zps--q--quiet)
- [zps -n](#zps--n--no-color)
- [TODO(s)](#todos)
- [License](#license)
- [Copyright](#copyright)
Expand Down Expand Up @@ -94,6 +95,9 @@ sudo make install

### GCC

With manual compilation, you might want to also pass
`-DNDEBUG` to disable runtime assertions.

```
cd src/ && gcc -s -O3 -Wall -Wextra -pedantic zps.c -o zps
```
Expand All @@ -119,41 +123,40 @@ Usage:
zps [options]
Options:
-r, --reap reap zombie processes
-x, --lreap list and reap zombie processes
-l, --list list zombie processes only
-p, --prompt show prompt for selecting processes
-f, --fd <num> set maximum file descriptors (default: 15)
-s, --silent run in silent mode
-v, --version show version
-h, --help show help
-v, --version show version
-h, --help show help
-a, --all list all user-space processes
-r, --reap reap zombie processes
-s, --signal <sig> signal to be used on zombie parents
-p, --prompt show prompt for selecting processes
-q, --quiet reap in quiet mode
-n, --no-color disable color output
```

### zps -r
### zps -r/--reap

![zps -r](https://user-images.githubusercontent.com/24392180/66898345-b68f7800-f001-11e9-86d7-694772a46ab7.gif)
![zps -r](assets/demo-reap.gif)

### zps -x
### zps -s/--signal

![zps -x](https://user-images.githubusercontent.com/24392180/66898624-34ec1a00-f002-11e9-9d5a-dde84c925119.gif)
![zps -s](assets/demo-signal.gif)

### zps -l
### zps -p/--prompt

![zps -l](https://user-images.githubusercontent.com/24392180/67201180-5f791100-f40e-11e9-8ff6-fcbbca443e9a.gif)
![zps -p](assets/demo-prompt.gif)

### zps -p
### zps -q/--quiet

![zps -p](https://user-images.githubusercontent.com/24392180/67624534-3c999300-f83a-11e9-95e4-46c3ce586197.gif)
![zps -q](assets/demo-quiet.gif)

## TODO(s)
### zps -n/--no-color

- Improve listing processes for long process names.
- Send `SIGCHLD` signal to the parent instead of terminating it.
![zps -n](assets/demo-no-color.gif)

## License

GNU General Public License v3.0 only ([GPL-3.0-only](https://www.gnu.org/licenses/gpl.txt))

## Copyright

Copyright © 2019-2023, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com)
Copyright © 2019-2024, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com)
56 changes: 29 additions & 27 deletions README_KO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### GNU/Linux에서 좀비 프로세스를 나열하고 끄는(reaping) 작은 유틸리티성 프로그램

![zps](https://user-images.githubusercontent.com/24392180/66898210-64e6ed80-f001-11e9-8e27-0ab3a7cabdca.gif)
![zps](assets/demo-top.gif)

[![Build](https://img.shields.io/github/workflow/status/orhun/zps/Continuous%20Integration?color=black&style=flat-square)](https://github.com/orhun/zps/actions?query=workflow%3A%22Continuous+Integration%22)
[![Docker Build](https://img.shields.io/github/workflow/status/orhun/zps/Docker%20Automated%20Builds?color=black&style=flat-square&label=docker)](https://github.com/orhun/zps/actions?query=workflow%3A%22Docker+Automated+Builds%22)
Expand All @@ -14,7 +14,7 @@

Unix와 컴퓨터 운영체제와 같은 Unix에서, [좀비 프로세스](https://en.wikipedia.org/wiki/Zombie_process) 또는 Defunct 프로세스는 (시스템 호출 [종료](<https://en.wikipedia.org/wiki/Exit_(system_call)>)을 통해 이루어진) 종료가 되어도 프로세스 목록에 남아 있습니다. 이 현상은 부모 프로세스가 (시스템 호출 [중단](<https://en.wikipedia.org/wiki/Wait(system_call)>)을 통해) 자식의 종료 상태를 알 필요가 있는 목록에서 자식 프로세스들에게 발생됩니다. 그렇게 좀비 프로세스를 목록에서 제거할 수 있었고, 이것을 "reaped"라고 합니다.

일반 프로세스들과 다르게, 좀비프로세스들은 이미 죽었기 때문에 [Kill](<https://en.wikipedia.org/wiki/Kill_(command)>) 명령어로 좀비프로세스들을 시스템에서 제거할 수 없습니다. (This is where the term's metaphor [zombie - an undead person] comes from.) 좀비 프로세스를 끄기 위해서, 'SIGCHLD' 신호를 부모 프로세스에게 [Kill](<https://en.wikipedia.org/wiki/Kill_(command)>) 명령어로 보내야 한다. 만약, 부모 프로세스가 좀비 프로세스를 끄는 것을 방해하는 경우에, 부모 프로세스는 대부분 'SIGTERM' 신호로 종료할 수 있는 방법도 있다. 자식 프로세스가 부모 프로세스를 잃었을 때, [init](https://en.wikipedia.org/wiki/Init) 프로세스(PID가 1번인 프로세스, 모든 프로세스의 조상 역할을 함.)가 자식 프로세스의 새로운 조상이 되고, 그것은 좀비 프로세스들을 시스템 호출 [중단](<https://en.wikipedia.org/wiki/Wait_(system_call)>)을 해서 끌 수 있습니다.
일반 프로세스들과 다르게, 좀비프로세스들은 이미 죽었기 때문에 [Kill](<https://en.wikipedia.org/wiki/Kill_(command)>) 명령어로 좀비프로세스들을 시스템에서 제거할 수 없습니다. (This is where the term's metaphor [zombie - an undead person] comes from.) 좀비 프로세스를 끄기 위해서, `SIGCHLD` 신호를 부모 프로세스에게 [Kill](<https://en.wikipedia.org/wiki/Kill_(command)>) 명령어로 보내야 한다. 만약, 부모 프로세스가 좀비 프로세스를 끄는 것을 방해하는 경우에, 부모 프로세스는 대부분 `SIGTERM` 신호로 종료할 수 있는 방법도 있다. 자식 프로세스가 부모 프로세스를 잃었을 때, [init](https://en.wikipedia.org/wiki/Init) 프로세스(PID가 1번인 프로세스, 모든 프로세스의 조상 역할을 함.)가 자식 프로세스의 새로운 조상이 되고, 그것은 좀비 프로세스들을 시스템 호출 [중단](<https://en.wikipedia.org/wiki/Wait_(system_call)>)을 해서 끌 수 있습니다.

좀비 프로세스들은 다른 프로세스들에 영향을 끼치거나 시스템 자원을 사용하지 않기 때문에 해롭지 않습니다. 하지만, 그들은 [프로세스 ID](https://en.wikipedia.org/wiki/Process_identifier)를 소유하고 있습니다. 이것은 모든 사용 가능한 PID를 좀비 프로세스가 차지하고 있다면 새로운 프로세스를 실행하는 것이 불가능 할 수 있습니다. Unix와 같은 시스템들에서는 프로세스 ID (`/proc/sys/kernel/pid_max`)를 한정된 양(제 우분투에서는 32768이 최댓값이네요.)만 갖고 있습니다. 이것만이 좀비 프로세스가 일으킬 수 있는 문제점입니다. 좀비 프로세스의 다른 위험성은 만약 좀비 프로세스가 프로세스 목록에 오랫동안 머무른다면, [메모리 누수](https://en.wikipedia.org/wiki/Resource_leak)를 일으킬 수 있다는 것입니다. 이러한 문제 외에도, 적은 양의 좀비 프로세스는 그들의 부모 프로세스에 버그를 생성할 지라도 시스템에 큰 영향을 주지는 않을 것입니다.

Expand All @@ -24,7 +24,7 @@ Unix와 컴퓨터 운영체제와 같은 Unix에서, [좀비 프로세스](https
cd example/ && gcc -O3 -Wall zproc.c -o zproc && ./zproc
```

특정 시간에 실행하고 있는 프로세스들의 정보의 리스트와 좀비 프로세스들을 표시하기 위해 **zps**를 만들었습니다. 이 프로그램은 `--reap` 옵션을 사용했을 때, 자동으로 좀비 프로세스들을 수 있습니다. 프로세스 리스트를 나열하기 전에 좀비 프로세스를 끄는 `--lreap` 옵션도 존재합니다. 좀 더 자세한 정보를 보려면 [사용법](https://github.com/orhun/zps#usage)을 보세요.
특정 시간에 실행하고 있는 프로세스들의 정보의 리스트와 좀비 프로세스들을 표시하기 위해 **zps**를 만들었습니다. 이 프로그램은, 자동으로 좀비 프로세스들을 종료할 수 있습니다. 좀 더 자세한 정보를 보려면 [사용법](https://github.com/orhun/zps#usage)을 보세요.
기술적으로, **zps**[/proc](https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html) 파일 시스템에서 프로세스 정보를 얻어오고, 프로세스를 출력하고 신호를 보내고 이외의 다른 동작들을 하기 위해 [C POSIX library](https://en.wikipedia.org/wiki/C_POSIX_library)를 이용합니다.

<!-- vim-markdown-toc GFM -->
Expand All @@ -40,10 +40,11 @@ cd example/ && gcc -O3 -Wall zproc.c -o zproc && ./zproc
- [이미지 생성](#이미지-생성)
- [컨테이너에서 이미지 실행](#컨테이너에서-이미지-실행)
- [사용법](#사용법)
- [zps -r](#zps--r)
- [zps -x](#zps--x)
- [zps -l](#zps--l)
- [zps -p](#zps--p)
- [zps -r](#zps--r--reap)
- [zps -s](#zps--s--signal)
- [zps -p](#zps--p--prompt)
- [zps -q](#zps--q--quiet)
- [zps -n](#zps--n--no-color)
- [TODO(s)](#todos)
- [License](#license)
- [Copyright](#copyright)
Expand Down Expand Up @@ -89,6 +90,8 @@ sudo make install

### GCC

수동 컴파일 시에는 런타임 어설션을 비활성화하려면 `-DNDEBUG`도 전달하실 수 있습니다.

```
cd src/ && gcc -s -O3 -Wall -Wextra -pedantic zps.c -o zps
```
Expand All @@ -114,43 +117,42 @@ docker run zps
zps [options]
옵션:
-r, --reap 좀비 프로세스 종료하기
-x, --lreap 프로세스 리스트 나열하고, 좀비 프로세스 종료하기
-l, --list 좀비 프로세스들만 목록에 보이게 하기
-p, --prompt 선택된 프로세스들만 Prompt 된 것을 보기
-f, --fd <num> 파일 디스크립터 최댓값 설정하기 (기본값: 15)
-s, --silent silent 모드로 실행하기
-v, --version 버전 보기
-h, --help 사용법 보기
-v, --version 버전 보기
-h, --help 사용법 보기
-a, --all 모든 사용자 공간 프로세스 나열
-r, --reap 좀비 프로세스 종료하기
-s, --signal <sig> 좀비 부모에 사용할 신호
-p, --prompt 프로세스 선택을 위한 프롬프트 표시
-q, --quiet quiet 모드로 실행하기
-n, --no-color 색상 출력 비활성화
```

### zps -r
### zps -r/--reap

![zps -r](https://user-images.githubusercontent.com/24392180/66898345-b68f7800-f001-11e9-86d7-694772a46ab7.gif)
![zps -r](assets/demo-reap.gif)

### zps -x
### zps -s/--signal

![zps -x](https://user-images.githubusercontent.com/24392180/66898624-34ec1a00-f002-11e9-9d5a-dde84c925119.gif)
![zps -s](assets/demo-signal.gif)

### zps -l
### zps -p/--prompt

![zps -l](https://user-images.githubusercontent.com/24392180/67201180-5f791100-f40e-11e9-8ff6-fcbbca443e9a.gif)
![zps -p](assets/demo-prompt.gif)

### zps -p
### zps -q/--quiet

![zps -p](https://user-images.githubusercontent.com/24392180/67624534-3c999300-f83a-11e9-95e4-46c3ce586197.gif)
![zps -q](assets/demo-quiet.gif)

## TODO(s)
### zps -n/--no-color

- 긴 이름을 가진 프로세스를 출력하는 것을 보완하는 것.
- 종료하는 것 대신에 부모 프로세스에게 `SIGCHLD` 신호를 보내는 것.
![zps -n](assets/demo-no-color.gif)

## License

GNU General Public License v3.0 only ([GPL-3.0-only](https://www.gnu.org/licenses/gpl.txt))

## Copyright

Copyright © 2019-2023, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com)
Copyright © 2019-2024, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com)

Translated to Korean by ahdelron.
Binary file added assets/demo-no-color.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/demo-prompt.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/demo-quiet.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/demo-reap.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/demo-signal.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/demo-top.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ WORKDIR /app/
# Copy source files to working directory
COPY src .
# Compile
RUN gcc -s -O3 -Wall -Wextra -pedantic zps.c -o zps
RUN gcc -s -O3 -Wall -Wextra -pedantic -DNDEBUG zps.c -o zps
# Create Alpine image for runtime
FROM alpine:3.16.2 AS runtime-image
# Set working directory
WORKDIR /root/
# Copy executable to working directory
COPY --from=build-image /app/zps .
# Execute
CMD ["./zps"]
CMD ["./zps"]
Loading

0 comments on commit 76ffe80

Please sign in to comment.